Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wp_insert_post_empty_content', 'test_user_can_do_this', PHP_INT_MAX -1, 2);
- function test_user_can_do_this($maybe_empty, $postarr) {
- // not a special role, ignore
- if (!is_client_user()) return $maybe_empty;
- $post_owner = $postarr['post_author'];
- // custom tests compare post owner vs current user
- if (is_grouped_with($post_owner)) return $maybe_empty;
- if (is_grouped_under($post_owner)) return $maybe_empty;
- // otherwise, deny save
- return true;
- }
Add Comment
Please, Sign In to add comment