• Hi.. i have much user that can submit the product from backend. the problem is, each user cant filter which their products only.

    Is there any way or plugin that can i using to hide other product and only show their own products only.

    I am very glad if anyone can help.
    Thanks.

Viewing 1 replies (of 1 total)
  • With the of below hook you can restrict other products for current vendor or user.Please customize below code accordingly.
    function posts_for_current_author($query) {
    global $pagenow;

    if( ‘edit.php’ != $pagenow || !$query->is_admin )
    return $query;

    if( !current_user_can( ‘edit_others_posts’ ) ) {
    global $user_ID;
    $query->set(‘author’, $user_ID );
    }
    return $query;
    }
    add_filter(‘pre_get_posts’, ‘posts_for_current_author’);

Viewing 1 replies (of 1 total)
  • The topic ‘Hide Product From Other User’ is closed to new replies.