Advertisement
GochiSiyan

limit user submit

Nov 11th, 2021
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. add_filter('jnews_frontend_submit_user_subscription', function ($value) {
  2. $current_user = wp_get_current_user();
  3. $allow = [
  4. 'subscriber',
  5. 'administrator',
  6. 'editor',
  7. 'author',
  8. ];
  9.  
  10. foreach ($allow as $user) {
  11. if (user_can($current_user, $user)) return $value;
  12. }
  13.  
  14. return false;
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement