Advertisement
GochiSiyan

author and subscriber only

Mar 30th, 2022
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function is_user_allow_access_frontend_submit() {
  2. $value = false;
  3. $user_id = get_current_user_id();
  4. $roles = get_userdata($user_id)->roles;
  5.  
  6. if ( get_theme_mod( 'jnews_frontend_submit_enable_woocommerce', false ) ) {
  7. $post_limit = get_user_meta( $user_id, 'listing_left', true );
  8.  
  9. if ( (int) $post_limit > 0 ) {
  10. $value = true;
  11. }
  12. }
  13.  
  14. if($roles[1] == 'author' || $roles[1] == 'subscriber' ) {
  15. $value = true;
  16. }
  17.  
  18. return $value;
  19. }
  20. add_filter( 'jnews_frontend_submit_user_subscription', 'is_user_allow_access_frontend_submit' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement