get a list of all the post consistent with user categories
-
Hello,
I added this function to get a list of all the post consistent with user categoriesadd_action( 'request', 'my_request' ); function my_request($request) { if(empty($request["cat"]) && is_admin() && strpos($GLOBALS['PHP_SELF'],"/wp-admin/edit.php") && !in_array('administrator', $currentUser->roles) && isset($request['post_type']) && $request['post_type']=='post'){ $currentUser = wp_get_current_user(); $include = get_user_meta( $currentUser->ID, '_access', true); $request["cat"]=implode(",",$include); } return $request; }
https://www.ads-software.com/plugins/restrict-author-posting/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get a list of all the post consistent with user categories’ is closed to new replies.