Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Who can be this codes for vendors in woocommerce

$
0
0

Replies: 0

The codes work only O Value. Different value 1,2,3,4, or etc. No work. I need to limit for vendors in woocommerce their publish product. Please edit codes.

add_action(“load-post-new.php”,”limit_user_by_post_count”);
function limit_user_by_post_count(){
$user = get_current_user_id();
if (!current_user_can( ‘manage_options’)) {
//not an admin – so impose the limit
$user_post_count = count_user_posts($user);
if($user_post_count>=10)
header(“Location: /wp-admin/edit.php”);
}
}

Please help me. Thank you so much!

  • This topic was modified 14 minutes ago by  yasko.

Viewing all articles
Browse latest Browse all 59525

Trending Articles