當前位置: 首頁>>代碼示例>>PHP>>正文


PHP remove_menu_page函數代碼示例

本文整理匯總了PHP中remove_menu_page函數的典型用法代碼示例。如果您正苦於以下問題:PHP remove_menu_page函數的具體用法?PHP remove_menu_page怎麽用?PHP remove_menu_page使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了remove_menu_page函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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
}
開發者ID:Alefal,項目名稱:amalficoastapps.it,代碼行數:26,代碼來源:functions.php

示例2: remove_admin_menus

function remove_admin_menus()
{
    if (!current_user_can('manage_options')) {
        // Only proceed if user does not have admin role.
        remove_menu_page('index.php');
        // Dashboard
        //remove_menu_page('edit.php'); 				// Posts
        //remove_menu_page('upload.php'); 			// Media
        //remove_menu_page('link-manager.php'); 			// Links
        //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('profile.php');
        // Profile
        remove_menu_page('tools.php');
        // Tools
        //remove_menu_page('options-general.php'); 		// Settings
        //remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' );	// Remove posts->tags submenu
        //remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=category' );	// Remove posts->categories submenu
        remove_submenu_page('index.php', 'index.php?page=simple_history_page');
        remove_submenu_page('themes.php', 'themes.php');
        remove_submenu_page('themes.php', 'widgets.php');
    }
}
開發者ID:CityOfPrescott,項目名稱:tabula-rasa_city-of-prescott,代碼行數:26,代碼來源:functions-admin.php

示例3: 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
}
開發者ID:naeemnur,項目名稱:ground,代碼行數:25,代碼來源:extend-administration.php

示例4: remove_menus

function remove_menus()
{
    remove_menu_page('edit-comments.php');
    //remove_menu_page( 'themes.php' );
    //remove_menu_page('plugins.php');
    //remove_menu_page('tools.php');
}
開發者ID:alexmacarthur,項目名稱:LyonCountyRepublicans,代碼行數:7,代碼來源:functions.php

示例5: edit_wp_menu

function edit_wp_menu()
{
    //-----------------------------------------------
    // Remove menu items
    //-----------------------------------------------
    remove_menu_page('edit-comments.php');
    //-----------------------------------------------
    // Add a menu item
    //-----------------------------------------------
    add_menu_page('New Comments', 'My Comments', 'manage_options', 'edit-comments.php', '', '', 6);
    //-----------------------------------------------
    // Change the menu order
    //-----------------------------------------------
    function change_menu_order($menu_order)
    {
        return array('index.php', 'themes.php', 'edit.php', 'upload.php');
    }
    add_filter('custom_menu_order', '__return_true');
    add_filter('menu_order', 'change_menu_order');
    //-----------------------------------------------
    // Rename Posts to Articles
    //-----------------------------------------------
    global $menu;
    global $submenu;
    $menu[5][0] = 'Articles';
    $submenu['edit.php'][5][0] = 'All Articles';
    $submenu['edit.php'][10][0] = 'Add an Article';
    $submenu['edit.php'][15][0] = 'Article Categories';
    $submenu['edit.php'][16][0] = 'Article Tags';
}
開發者ID:AlejandroPerezMartin,項目名稱:wordpress-custom-admin,代碼行數:30,代碼來源:functions.php

示例6: 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');
    }
}
開發者ID:josephkes,項目名稱:Customise-WordPress-Admin,代碼行數:29,代碼來源:customise-wp-admin.php

示例7: remove_menus

function remove_menus()
{
    remove_menu_page('index.php');
    //Консоль
    remove_menu_page('edit-comments.php');
    //Комментарии
}
開發者ID:aleksandr-fishchenko,項目名稱:abc-nuorisotoiminta-control-panel-plugin,代碼行數:7,代碼來源:changing-admin-panel-appearance.php

示例8: remove_admin_items

function remove_admin_items()
{
    // Posts
    remove_menu_page('edit.php');
    // Comments
    remove_menu_page('edit-comments.php');
}
開發者ID:poundandgrain,項目名稱:WPSkeletonTheme,代碼行數:7,代碼來源:functions.php

示例9: hide_dashboard

function hide_dashboard()
{
    global $blog, $current_user, $id, $parent_file, $wphd_user_capability;
    if (!current_user_can('' . $wphd_user_capability . '')) {
        /* First, let's get rid of the Help menu, Update nag, Personal Options section */
        echo "\n" . '<style type="text/css" media="screen">#your-profile { display: none; } .update-nag, #contextual-help-wrap, #contextual-help-link-wrap { display: none !important; }</style>';
        echo "\n" . '<script type="text/javascript">jQuery(document).ready(function($) { $(\'form#your-profile > h3:first\').hide(); $(\'form#your-profile > table:first\').hide(); $(\'form#your-profile\').show(); });</script>' . "\n";
        /* Now, let's fix the sidebar admin menu - go away, Dashboard link. */
        /* If Multisite, check whether they are in the User Dashboard before removing links */
        $user_id = get_current_user_id();
        $blogs = get_blogs_of_user($user_id);
        if (is_multisite() && is_admin() && empty($blogs)) {
            return;
        } else {
            remove_menu_page('index.php');
            /* Hides Dashboard menu */
            remove_menu_page('separator1');
            /* Hides separator under Dashboard menu*/
        }
        /* Last, but not least, let's redirect folks to their profile when they login or if they try to access the Dashboard via direct URL */
        if (is_multisite() && is_admin() && empty($blogs)) {
            return;
        } else {
            if ($parent_file == 'index.php') {
                if (headers_sent()) {
                    echo '<meta http-equiv="refresh" content="0;url=' . admin_url('profile.php') . '">';
                    echo '<script type="text/javascript">document.location.href="' . admin_url('profile.php') . '"</script>';
                } else {
                    wp_redirect(admin_url('profile.php'));
                    exit;
                }
            }
        }
    }
}
開發者ID:gp6shc,項目名稱:aok,代碼行數:35,代碼來源:hide-dashboard.php

示例10: remove_menu_pages

function remove_menu_pages()
{
    //remove_menu_page('tools.php');
    remove_menu_page('edit-comments.php');
    //remove_menu_page('edit.php');
    //remove_menu_page('plugins.php');
}
開發者ID:r1987,項目名稱:plank_wp,代碼行數:7,代碼來源:functions.php

示例11: custom_menu_page_removing

/**
 * Remove unused menu items
 */
function custom_menu_page_removing()
{
    global $menu;
    foreach (['edit-comments.php', 'upload.php', 'edit.php?post_type=page'] as $m) {
        remove_menu_page($m);
    }
}
開發者ID:richard-crowther,項目名稱:WordPress-DMS-Theme,代碼行數:10,代碼來源:functions.php

示例12: ticr_remove_admin_menu_items

function ticr_remove_admin_menu_items()
{
    $remove_items = array('dt_portfolio', 'dt_testimonials', 'dt_team', 'dt_benefits', 'dt_slideshow');
    foreach ($remove_items as $item) {
        remove_menu_page('edit.php?post_type=' . $item);
    }
}
開發者ID:scottnkerr,項目名稱:eeco,代碼行數:7,代碼來源:ticr-eeco-theme-extension.php

示例13: bp_core_admin_backpat_menu

/**
 * In BP 1.6, the top-level admin menu was removed. For backpat, this function
 * keeps the top-level menu if a plugin has registered a menu into the old
 * 'bp-general-settings' menu.
 *
 * The old "bp-general-settings" page was renamed "bp-components".
 *
 * @global array $_parent_pages
 * @global array $_registered_pages
 * @global array $submenu
 * @since BuddyPress (1.6)
 */
function bp_core_admin_backpat_menu() {
	global $_parent_pages, $_registered_pages, $submenu;

	// If there's no bp-general-settings menu (perhaps because the current
	// user is not an Administrator), there's nothing to do here
	if ( ! isset( $submenu['bp-general-settings'] ) ) {
		return;
	}

	/**
	 * By default, only the core "Help" submenu is added under the top-level BuddyPress menu.
	 * This means that if no third-party plugins have registered their admin pages into the
	 * 'bp-general-settings' menu, it will only contain one item. Kill it.
	 */
	if ( 1 != count( $submenu['bp-general-settings'] ) ) {
		return;
	}

	// This removes the top-level menu
	remove_submenu_page( 'bp-general-settings', 'bp-general-settings' );
	remove_menu_page( 'bp-general-settings' );

	// These stop people accessing the URL directly
	unset( $_parent_pages['bp-general-settings'] );
	unset( $_registered_pages['toplevel_page_bp-general-settings'] );
}
開發者ID:pombredanne,項目名稱:ArcherSys,代碼行數:38,代碼來源:bp-core-functions.php

示例14: wp_user_profiles_admin_menus

/**
 * Add admin pages and setup submenus
 *
 * @since 0.1.0
 */
function wp_user_profiles_admin_menus()
{
    // Empty hooks array
    $hooks = array();
    $file = wp_user_profiles_get_file();
    $sections = wp_user_profiles_sections();
    // Add a visbile "Your Profile" link
    if ('users.php' === $file) {
        // Remove the core "Your Profile" submenu
        unset($GLOBALS['submenu']['users.php'][15]);
        // Add (and quickly remove) submenu pages
        foreach ($sections as $tab) {
            $hooks[] = add_submenu_page($file, $tab['name'], $tab['name'], $tab['cap'], $tab['slug'], 'wp_user_profiles_user_admin');
            remove_submenu_page($file, $tab['slug']);
        }
        // Re-add new "Your Profile" submenu
        add_submenu_page($file, esc_html__('Your Profile', 'wp-user-profiles'), esc_html__('Your Profile', 'wp-user-profiles'), 'read', 'profile', 'wp_user_profiles_user_admin');
        // Fudge the highlighted subnav item
        foreach ($hooks as $hook) {
            add_action("admin_head-{$hook}", 'wp_user_profiles_admin_menu_highlight');
        }
        // User admin needs some coercing
    } elseif (is_user_admin()) {
        remove_menu_page('profile.php');
        foreach ($sections as $tab) {
            add_menu_page($tab['name'], $tab['name'], 'exist', $tab['slug'], 'wp_user_profiles_user_admin', $tab['icon'], $tab['order']);
        }
    } else {
        add_submenu_page($file, esc_html__('Profile', 'wp-user-profiles'), esc_html__('Profile', 'wp-user-profiles'), 'read', 'profile', 'wp_user_profiles_user_admin');
    }
}
開發者ID:bradyvercher,項目名稱:wp-user-profiles,代碼行數:36,代碼來源:admin.php

示例15: gsw_manage_menu_pages

/** Add plugin menu ***/
function gsw_manage_menu_pages()
{
    if (current_user_can('manage_options')) {
        add_menu_page('Germany Says Welcome Overview', 'Germany Says Welcome', 'read', 'gsw_overview', 'gsw_overview', GSW_PATH . 'images/logo_small.png');
        add_submenu_page('gsw_overview', 'Overview for the GSW Plugin', 'Overview', 'read', 'gsw_overview', 'gsw_intro');
    } else {
        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_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('options-general.php');
        // Settings
        remove_submenu_page('index.php', 'update-core.php');
    }
}
開發者ID:socialc0de,項目名稱:germany-says-welcome-wordpress-plugin,代碼行數:30,代碼來源:germany-says-welcome.php


注:本文中的remove_menu_page函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。