本文整理汇总了PHP中remove_submenu_page函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_submenu_page函数的具体用法?PHP remove_submenu_page怎么用?PHP remove_submenu_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_submenu_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: my_remove_menu_pages
function my_remove_menu_pages()
{
//remove_menu_page( 'edit.php' ); // Posts
//remove_menu_page( 'upload.php' ); // Media
remove_menu_page('link-manager.php');
// Links
remove_menu_page('edit-comments.php');
// Comments
remove_menu_page('edit.php?post_type=page');
// Pages
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=category');
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=post_tag');
//remove_menu_page( 'plugins.php' ); // Plugins
//remove_menu_page( 'themes.php' ); // Appearance
//remove_menu_page( 'users.php' ); // Users
remove_menu_page('tools.php');
// Tools
//remove_menu_page( 'profile.php' ); // Tools
//remove_menu_page('options-general.php'); // Settings
//remove_submenu_page ( 'index.php', 'update-core.php' ); //Dashboard->Updates
//remove_submenu_page ( 'themes.php', 'themes.php' ); // Appearance-->Themes
//remove_submenu_page ( 'themes.php', 'widgets.php' ); // Appearance-->Widgets
//remove_submenu_page ( 'themes.php', 'theme-editor.php' ); // Appearance-->Editor
//remove_submenu_page ( 'options-general.php', 'options-general.php' ); // Settings->General
//remove_submenu_page ( 'options-general.php', 'options-writing.php' ); // Settings->writing
//remove_submenu_page ( 'options-general.php', 'options-reading.php' ); // Settings->Reading
//remove_submenu_page ( 'options-general.php', 'options-discussion.php' ); // Settings->Discussion
//remove_submenu_page ( 'options-general.php', 'options-media.php' ); // Settings->Media
//remove_submenu_page ( 'options-general.php', 'options-privacy.php' ); // Settings->Privacy
}
示例2: modify_menu
/**
* 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');
}
示例3: uas_edit_admin_menus
/**
* Remove menu items on a per user bases
*/
function uas_edit_admin_menus()
{
global $menu;
global $current_user;
global $storedmenu;
global $storedsubmenu;
global $submenu;
// Store the original menu
$storedmenu = $menu;
// Store the original submenu
$storedsubmenu = $submenu;
$uas_options = uas_get_admin_options();
$newmenu = array();
if (!isset($menu)) {
return;
}
// Rebuild menu based on saved options
foreach ($menu as $menuitem) {
if (isset($menuitem[5]) && isset($uas_options[$current_user->user_nicename][sanitize_key($menuitem[5])]) && 1 == $uas_options[$current_user->user_nicename][sanitize_key($menuitem[5])]) {
remove_menu_page($menuitem[2]);
} else {
// Lets check the submenus
if (isset($storedsubmenu[$menuitem[2]])) {
foreach ($storedsubmenu[$menuitem[2]] as $subsub) {
$combinedname = sanitize_key($menuitem[5] . $subsub[2]);
if (isset($subsub[2]) && isset($uas_options[$current_user->user_nicename][$combinedname]) && 1 == $uas_options[$current_user->user_nicename][$combinedname]) {
remove_submenu_page($menuitem[2], $subsub[2]);
}
}
}
}
}
}
示例4: hide_menu
function hide_menu()
{
global $current_user;
$user_id = get_current_user_id();
// echo "user:".$user_id; // Use this to find your user id quickly
if ($user_id != '1') {
remove_menu_page('index.php');
//Dashboard
remove_menu_page('upload.php');
//Media
remove_menu_page('edit-comments.php');
//Comments
remove_menu_page('plugins.php');
//Plugins
remove_submenu_page('themes.php', 'themes.php');
remove_submenu_page('themes.php', 'theme-editor.php');
remove_submenu_page('themes.php', 'customize.php');
remove_menu_page('nav-menus.php');
//Editar Menus
// remove_menu_page( 'users.php' ); Users
remove_menu_page('tools.php');
//Tools
remove_menu_page('options-general.php');
//Settings
remove_menu_page('edit.php?post_type=acf');
//Advanced Custom Fields
remove_menu_page('admin.php?page=cpt_main_menu');
//Custom Post Types
remove_menu_page('themes.php');
//Custom Fields
}
}
示例5: d7_remove_menus
/**
* Remove some admin menu items
*
* @package d7
* @subpackage boilerplate-plugin_filters+hooks
* @internal only called as `admin_menu` action
*
*/
function d7_remove_menus()
{
remove_menu_page('edit.php');
remove_menu_page('edit-comments.php');
remove_submenu_page('themes.php', 'theme-editor.php');
remove_submenu_page('plugins.php', 'plugin-editor.php');
}
示例6: nicdark_remove_taxonomy_packages
function nicdark_remove_taxonomy_packages()
{
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=destination-package');
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=typology-package');
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=duration-package');
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=person-package');
}
示例7: remove_admin_menus
/**
* Remove admin pages for updates and extensions
*
* @since 0.0.1
* @return void
*/
public function remove_admin_menus()
{
/** Remove Gravity Forms Update page */
remove_submenu_page('gf_edit_forms', 'gf_update');
remove_submenu_page('gf_new_form', 'gf_update');
remove_submenu_page('gf_entries', 'gf_update');
}
示例8: admin_head
/**
* Add styles just for this page, and remove dashboard page links.
*/
public function admin_head()
{
remove_submenu_page('index.php', 'sm-about');
remove_submenu_page('index.php', 'sm-faqs');
remove_submenu_page('index.php', 'sm-beta');
?>
<style type="text/css">
/*<![CDATA[*/
.about-wrap h3 {
margin-top: 1em;
margin-right: 0em;
margin-bottom: 0.1em;
font-size: 1.25em;
line-height: 1.3em;
}
.about-wrap p {
margin-top: 0.6em;
margin-bottom: 0.8em;
line-height: 1.6em;
font-size: 14px;
}
.about-wrap .feature-section {
padding-bottom: 5px;
}
/*]]>*/
</style>
<?php
}
示例9: remove_admin_submenus
function remove_admin_submenus()
{
global $current_user;
wp_get_current_user();
if ($current_user->user_level < 10) {
remove_submenu_page('themes.php', 'theme-editor.php');
remove_submenu_page('themes.php', 'themes.php');
//remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' );
//remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=category' );
//remove_submenu_page( 'edit.php', 'post-new.php' );
//remove_submenu_page( 'themes.php', 'nav-menus.php' );
remove_submenu_page('themes.php', 'widgets.php');
remove_submenu_page('themes.php', 'theme-editor.php');
remove_submenu_page('plugins.php', 'plugin-editor.php');
remove_submenu_page('plugins.php', 'plugin-install.php');
//remove_submenu_page( 'users.php', 'users.php' );
remove_submenu_page('users.php', 'user-new.php');
//remove_submenu_page( 'upload.php', 'media-new.php' );
remove_submenu_page('options-general.php', 'options-writing.php');
remove_submenu_page('options-general.php', 'options-discussion.php');
remove_submenu_page('options-general.php', 'options-reading.php');
remove_submenu_page('options-general.php', 'options-discussion.php');
remove_submenu_page('options-general.php', 'options-media.php');
remove_submenu_page('options-general.php', 'options-privacy.php');
remove_submenu_page('options-general.php', 'options-permalinks.php');
remove_submenu_page('index.php', 'update-core.php');
remove_action('welcome_panel', 'wp_welcome_panel');
}
}
示例10: remove_menus
function remove_menus()
{
//remove_menu_page( 'index.php' ); //Dashboard
remove_submenu_page('index.php', 'update-core.php');
//remove_submenu_page( $menu_slug, $submenu_slug );
remove_menu_page('edit.php');
//Posts
remove_menu_page('upload.php');
//Media
remove_menu_page('edit.php?post_type=page');
//Pages
remove_menu_page('edit-comments.php');
//Comments
remove_menu_page('themes.php');
//Appearance
remove_menu_page('plugins.php');
//Plugins
remove_menu_page('users.php');
//Users
remove_menu_page('tools.php');
//Tools
remove_menu_page('options-general.php');
//Settings
remove_menu_page('edit.php?post_type=acf');
//ACF
}
示例11: pix_admin_menu
function pix_admin_menu()
{
$pix_menu = add_menu_page(__('Pix Plugins', 'pix'), __('Pix Plugins', 'pix'), 'manage_options', 'pix-plugins', NULL, INFINITE_LOAD_URL . '/images/logo.png');
$pix_infinite_load_menu = add_submenu_page('pix-plugins', __('Infinite Load', 'pix'), __('Infinite Load', 'pix'), 'manage_options', 'pix-infinite-load', 'pix_infinite_load_settings');
remove_submenu_page('pix-plugins', 'pix-plugins');
add_action('admin_print_scripts-' . $pix_infinite_load_menu, 'pix_add_admin_assets');
}
示例12: ground_remove_menu_links
function ground_remove_menu_links()
{
remove_menu_page('index.php');
// Dashboard
remove_menu_page('edit.php');
// Posts
remove_menu_page('upload.php');
// Media
remove_menu_page('edit.php?post_type=page');
// Pages
remove_menu_page('edit-comments.php');
// Comments
remove_menu_page('themes.php');
// Appearance
remove_menu_page('plugins.php');
// Plugins
remove_menu_page('users.php');
// Users
remove_menu_page('tools.php');
// Tools
remove_menu_page('options-general.php');
// Settings
remove_submenu_page('themes.php', 'theme-editor.php');
// Submenu
}
示例13: jk_remove_menus
function jk_remove_menus()
{
// Posts
remove_menu_page('edit.php');
// Comments
remove_menu_page('edit-comments.php');
// Projects
remove_menu_page('edit.php?post_type=project');
// Testimonials
remove_menu_page('edit.php?post_type=testimonial');
// Profile
remove_menu_page('profile.php');
// Remove for all users below Administrator
$user = wp_get_current_user();
if (!$user->has_cap('manage_options')) {
// Tools
remove_menu_page('tools.php');
// My Sites
remove_menu_page('my-sites.php');
}
// Remove for all users below Super-Admin
$user = wp_get_current_user();
if (!$user->has_cap('manage_network')) {
// Plugins
remove_menu_page('plugins.php');
// Widgets submenu
$page = remove_submenu_page('themes.php', 'widgets.php');
}
}
示例14: popmake_remove_admin_subpages
function popmake_remove_admin_subpages()
{
remove_submenu_page('index.php', 'popmake-about');
remove_submenu_page('index.php', 'popmake-changelog');
remove_submenu_page('index.php', 'popmake-getting-started');
remove_submenu_page('index.php', 'popmake-credits');
}
示例15: tb_newsletter_menu
function tb_newsletter_menu()
{
add_menu_page('Newsletter', 'Newsletter', 'manage_options', 'newsletter', '', 'dashicons-email-alt');
add_submenu_page('newsletter', 'Envoyer', 'Envoyer la newsletter', 'manage_options', 'newsletter_send', 'tb_newsletter_send');
add_submenu_page('newsletter', 'Réglages', 'Réglages', 'manage_options', 'newsletter_config', 'tb_newsletter_config');
remove_submenu_page('newsletter', 'newsletter');
}