Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // current user
- $user = new WP_User(get_current_user_id());
- // the custom field on the user's pages
- $showintern = get_field('user_intern_yes', 'user_'.$user->ID);
- // check if user has set $showintern field to "yes"
- if($showintern == 1) :
- // show stuff
- endif;
- function wpse28782_remove_menu_items() {
- $user = new WP_User(get_current_user_id());
- $showintern = get_field('user_intern_yes', 'user_'.$user->ID);
- if($showintern == 0) :
- remove_menu_page( 'edit.php?post_type=intern' );
- remove_menu_page( 'edit-comments.php' );
- endif;
- }
- add_action( 'admin_menu', 'wpse28782_remove_menu_items' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement