本文整理汇总了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
}
示例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');
}
}
示例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
}
示例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');
}
示例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';
}
示例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');
}
}
示例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');
}
示例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;
}
}
}
}
}
示例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');
}
示例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);
}
}
示例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);
}
}
示例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'] );
}
示例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');
}
}
示例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');
}
}