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.