Php 如何防止店长编辑或删除其他店长产品?

Php 如何防止店长编辑或删除其他店长产品?,php,wordpress,Php,Wordpress,我有一个使用woocommerce安装WordPress的网站。任何人都可以在这里注册成为商店经理。他们可以在那里发布自己的产品。我希望他们只能在“产品”菜单下看到自己的产品和订单菜单。实际的功能是什么。我使用此功能从主菜单中删除了Woocomece菜单 add_action( 'admin_menu', 'remove_menus' ); function remove_menus(){ // If the current user is not an admin if ( !current

我有一个使用woocommerce安装WordPress的网站。任何人都可以在这里注册成为商店经理。他们可以在那里发布自己的产品。我希望他们只能在“产品”菜单下看到自己的产品和订单菜单。实际的功能是什么。我使用此功能从主菜单中删除了Woocomece菜单

add_action( 'admin_menu', 'remove_menus' );
function remove_menus(){

// If the current user is not an admin
if ( !current_user_can('manage_options') ) {

    remove_menu_page( 'woocommerce' ); // WooCommerce admin menu slug

}
 }

产品
-----添加产品
-----订单
-----产品
商店经理只能这样看。

任何想法都可以。

我不认为woocommerce是为了打造一个多租户商店。我如何才能做到我想要的那样?请一位知道如何做的开发人员?有任何来源可以学习吗?
// Show only posts and media related to logged in author
add_action('pre_get_posts', 'query_set_only_author' );
function query_set_only_author( $wp_query ) {
    global $current_user;
    if( is_admin() && !current_user_can('edit_others_posts') ) {
        $wp_query->set( 'author', $current_user->ID );
        add_filter('views_edit-post', 'fix_post_counts');
        add_filter('views_upload', 'fix_media_counts');
    }
}