Support

Account

Home Forums General Issues Post Object Query By Author Reply To: Post Object Query By Author

  • I was wondering,
    you can set the filter applies only to users and not admins or moderators?

    I tried to use this code to differentiate between users and admin, but it is as if nothing is filtering.

    if ( ! is_admin() ) {
             // modify the order
             $current_user = wp_get_current_user();
             $user_id = $current_user->ID;
             $args['author']=$user_id;
             $args['authors']=$user_id;
             $args['post_type']='stand';
             return $args;
    } 
    else { $args['post_type']='stand'; return $args; }
    

    There is solution?
    Thanks