/** * Modifies the admin menu for specific roles. * * @since v1.0.0 * @access private */ function modify_menu() { if (jc_userroles_current_role() != 'jobs_for_jets_manager') { return; } remove_submenu_page('edit.php?post_type=event', 'event-calendar'); }
/** * Modifies the admin menu for specific roles. * * @since v1.0.0 * @access private */ function modify_menu() { if (jc_userroles_current_role() != 'editor') { return; } remove_menu_page('edit-comments.php'); remove_menu_page('edit.php?post_type=jc-faq'); remove_menu_page('edit.php?post_type=jc-location'); remove_menu_page('edit.php?post_type=jc-spotlight'); }
/** * Add review MB and remove a couple others. * * @since 1.2.0 * @access private */ function modify_meta_boxes() { if (jc_userroles_current_role() == 'site_section_manager' || current_user_can('manage_options') && get_post_meta(get_the_ID(), 'jc_revision_parent', true)) { remove_meta_box('submitdiv', null, 'side'); remove_meta_box('pageparentdiv', null, 'side'); remove_meta_box('expirationdatediv', 'page', 'side'); add_meta_box('jc_section_manager_submit', 'Submit', array($this, current_user_can('manage_options') ? 'push_revision_mb' : 'save_revision_mb'), 'page', 'side', 'high'); } }
/** * Modifies the "no active forms" message. * * @since v1.0.0 * @access private * * @param string $message * * @return string */ function modify_gf_no_forms_message($message) { if (jc_userroles_current_role() != 'forms_manager') { return $message; } if ($message == "You don't have any active forms. Let's go %screate one%s") { return 'You don\'t have any active forms. If you feel this is a mistake, please contact the system administrator.'; } return $message; }