Edit File by line
/home/zeestwma/richards.../wp-admin...
File: menu.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Build Administration Menu.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Constructs the admin menu.
[9] Fix | Delete
*
[10] Fix | Delete
* The elements in the array are:
[11] Fix | Delete
* 0: Menu item name.
[12] Fix | Delete
* 1: Minimum level or capability required.
[13] Fix | Delete
* 2: The URL of the item's file.
[14] Fix | Delete
* 3: Page title.
[15] Fix | Delete
* 4: Classes.
[16] Fix | Delete
* 5: ID.
[17] Fix | Delete
* 6: Icon for top level menu.
[18] Fix | Delete
*
[19] Fix | Delete
* @global array $menu
[20] Fix | Delete
*/
[21] Fix | Delete
[22] Fix | Delete
$menu[2] = array( __( 'Dashboard' ), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
[23] Fix | Delete
[24] Fix | Delete
$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
[25] Fix | Delete
[26] Fix | Delete
if ( is_multisite() ) {
[27] Fix | Delete
$submenu['index.php'][5] = array( __( 'My Sites' ), 'read', 'my-sites.php' );
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
if ( ! is_multisite() || current_user_can( 'update_core' ) ) {
[31] Fix | Delete
$update_data = wp_get_update_data();
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
if ( ! is_multisite() ) {
[35] Fix | Delete
if ( current_user_can( 'update_core' ) ) {
[36] Fix | Delete
$cap = 'update_core';
[37] Fix | Delete
} elseif ( current_user_can( 'update_plugins' ) ) {
[38] Fix | Delete
$cap = 'update_plugins';
[39] Fix | Delete
} elseif ( current_user_can( 'update_themes' ) ) {
[40] Fix | Delete
$cap = 'update_themes';
[41] Fix | Delete
} else {
[42] Fix | Delete
$cap = 'update_languages';
[43] Fix | Delete
}
[44] Fix | Delete
$submenu['index.php'][10] = array(
[45] Fix | Delete
sprintf(
[46] Fix | Delete
/* translators: %s: Number of pending updates. */
[47] Fix | Delete
__( 'Updates %s' ),
[48] Fix | Delete
sprintf(
[49] Fix | Delete
'<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
[50] Fix | Delete
$update_data['counts']['total'],
[51] Fix | Delete
number_format_i18n( $update_data['counts']['total'] )
[52] Fix | Delete
)
[53] Fix | Delete
),
[54] Fix | Delete
$cap,
[55] Fix | Delete
'update-core.php',
[56] Fix | Delete
);
[57] Fix | Delete
unset( $cap );
[58] Fix | Delete
}
[59] Fix | Delete
[60] Fix | Delete
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
[61] Fix | Delete
[62] Fix | Delete
// $menu[5] = Posts.
[63] Fix | Delete
[64] Fix | Delete
$menu[10] = array( __( 'Media' ), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'dashicons-admin-media' );
[65] Fix | Delete
$submenu['upload.php'][5] = array( __( 'Library' ), 'upload_files', 'upload.php' );
[66] Fix | Delete
$submenu['upload.php'][10] = array( __( 'Add New Media File' ), 'upload_files', 'media-new.php' );
[67] Fix | Delete
$i = 15;
[68] Fix | Delete
foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) {
[69] Fix | Delete
if ( ! $tax->show_ui || ! $tax->show_in_menu ) {
[70] Fix | Delete
continue;
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
$submenu['upload.php'][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&amp;post_type=attachment' );
[74] Fix | Delete
}
[75] Fix | Delete
unset( $tax, $i );
[76] Fix | Delete
[77] Fix | Delete
$menu[15] = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' );
[78] Fix | Delete
$submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' );
[79] Fix | Delete
$submenu['link-manager.php'][10] = array( __( 'Add New Link' ), 'manage_links', 'link-add.php' );
[80] Fix | Delete
$submenu['link-manager.php'][15] = array( __( 'Link Categories' ), 'manage_categories', 'edit-tags.php?taxonomy=link_category' );
[81] Fix | Delete
[82] Fix | Delete
// $menu[20] = Pages.
[83] Fix | Delete
[84] Fix | Delete
// Avoid the comment count query for users who cannot edit_posts.
[85] Fix | Delete
if ( current_user_can( 'edit_posts' ) ) {
[86] Fix | Delete
$awaiting_mod = wp_count_comments();
[87] Fix | Delete
$awaiting_mod = $awaiting_mod->moderated;
[88] Fix | Delete
$awaiting_mod_i18n = number_format_i18n( $awaiting_mod );
[89] Fix | Delete
/* translators: %s: Number of comments. */
[90] Fix | Delete
$awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n );
[91] Fix | Delete
[92] Fix | Delete
$menu[25] = array(
[93] Fix | Delete
/* translators: %s: Number of comments. */
[94] Fix | Delete
sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count" aria-hidden="true">' . $awaiting_mod_i18n . '</span><span class="comments-in-moderation-text screen-reader-text">' . $awaiting_mod_text . '</span></span>' ),
[95] Fix | Delete
'edit_posts',
[96] Fix | Delete
'edit-comments.php',
[97] Fix | Delete
'',
[98] Fix | Delete
'menu-top menu-icon-comments',
[99] Fix | Delete
'menu-comments',
[100] Fix | Delete
'dashicons-admin-comments',
[101] Fix | Delete
);
[102] Fix | Delete
unset( $awaiting_mod );
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
$submenu['edit-comments.php'][0] = array( __( 'All Comments' ), 'edit_posts', 'edit-comments.php' );
[106] Fix | Delete
[107] Fix | Delete
$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group.
[108] Fix | Delete
[109] Fix | Delete
$types = (array) get_post_types(
[110] Fix | Delete
array(
[111] Fix | Delete
'show_ui' => true,
[112] Fix | Delete
'_builtin' => false,
[113] Fix | Delete
'show_in_menu' => true,
[114] Fix | Delete
)
[115] Fix | Delete
);
[116] Fix | Delete
$builtin = array( 'post', 'page' );
[117] Fix | Delete
foreach ( array_merge( $builtin, $types ) as $ptype ) {
[118] Fix | Delete
$ptype_obj = get_post_type_object( $ptype );
[119] Fix | Delete
// Check if it should be a submenu.
[120] Fix | Delete
if ( true !== $ptype_obj->show_in_menu ) {
[121] Fix | Delete
continue;
[122] Fix | Delete
}
[123] Fix | Delete
$ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first.
[124] Fix | Delete
$ptype_for_id = sanitize_html_class( $ptype );
[125] Fix | Delete
[126] Fix | Delete
$menu_icon = 'dashicons-admin-post';
[127] Fix | Delete
if ( is_string( $ptype_obj->menu_icon ) ) {
[128] Fix | Delete
// Special handling for an empty div.wp-menu-image, data:image/svg+xml, and Dashicons.
[129] Fix | Delete
if ( 'none' === $ptype_obj->menu_icon || 'div' === $ptype_obj->menu_icon
[130] Fix | Delete
|| str_starts_with( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' )
[131] Fix | Delete
|| str_starts_with( $ptype_obj->menu_icon, 'dashicons-' )
[132] Fix | Delete
) {
[133] Fix | Delete
$menu_icon = $ptype_obj->menu_icon;
[134] Fix | Delete
} else {
[135] Fix | Delete
$menu_icon = esc_url( $ptype_obj->menu_icon );
[136] Fix | Delete
}
[137] Fix | Delete
} elseif ( in_array( $ptype, $builtin, true ) ) {
[138] Fix | Delete
$menu_icon = 'dashicons-admin-' . $ptype;
[139] Fix | Delete
}
[140] Fix | Delete
[141] Fix | Delete
$menu_class = 'menu-top menu-icon-' . $ptype_for_id;
[142] Fix | Delete
// 'post' special case.
[143] Fix | Delete
if ( 'post' === $ptype ) {
[144] Fix | Delete
$menu_class .= ' open-if-no-js';
[145] Fix | Delete
$ptype_file = 'edit.php';
[146] Fix | Delete
$post_new_file = 'post-new.php';
[147] Fix | Delete
$edit_tags_file = 'edit-tags.php?taxonomy=%s';
[148] Fix | Delete
} else {
[149] Fix | Delete
$ptype_file = "edit.php?post_type=$ptype";
[150] Fix | Delete
$post_new_file = "post-new.php?post_type=$ptype";
[151] Fix | Delete
$edit_tags_file = "edit-tags.php?taxonomy=%s&amp;post_type=$ptype";
[152] Fix | Delete
}
[153] Fix | Delete
[154] Fix | Delete
if ( in_array( $ptype, $builtin, true ) ) {
[155] Fix | Delete
$ptype_menu_id = 'menu-' . $ptype_for_id . 's';
[156] Fix | Delete
} else {
[157] Fix | Delete
$ptype_menu_id = 'menu-posts-' . $ptype_for_id;
[158] Fix | Delete
}
[159] Fix | Delete
/*
[160] Fix | Delete
* If $ptype_menu_position is already populated or will be populated
[161] Fix | Delete
* by a hard-coded value below, increment the position.
[162] Fix | Delete
*/
[163] Fix | Delete
$core_menu_positions = array( 59, 60, 65, 70, 75, 80, 85, 99 );
[164] Fix | Delete
while ( isset( $menu[ $ptype_menu_position ] ) || in_array( $ptype_menu_position, $core_menu_positions, true ) ) {
[165] Fix | Delete
++$ptype_menu_position;
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
$menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon );
[169] Fix | Delete
$submenu[ $ptype_file ][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, $ptype_file );
[170] Fix | Delete
$submenu[ $ptype_file ][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, $post_new_file );
[171] Fix | Delete
[172] Fix | Delete
$i = 15;
[173] Fix | Delete
foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
[174] Fix | Delete
if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array( $ptype, (array) $tax->object_type, true ) ) {
[175] Fix | Delete
continue;
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
$submenu[ $ptype_file ][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, sprintf( $edit_tags_file, $tax->name ) );
[179] Fix | Delete
}
[180] Fix | Delete
}
[181] Fix | Delete
unset( $ptype, $ptype_obj, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax, $post_new_file );
[182] Fix | Delete
[183] Fix | Delete
$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
[184] Fix | Delete
[185] Fix | Delete
$appearance_cap = current_user_can( 'switch_themes' ) ? 'switch_themes' : 'edit_theme_options';
[186] Fix | Delete
[187] Fix | Delete
$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
[188] Fix | Delete
[189] Fix | Delete
$count = '';
[190] Fix | Delete
if ( ! is_multisite() && current_user_can( 'update_themes' ) ) {
[191] Fix | Delete
if ( ! isset( $update_data ) ) {
[192] Fix | Delete
$update_data = wp_get_update_data();
[193] Fix | Delete
}
[194] Fix | Delete
$count = sprintf(
[195] Fix | Delete
'<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>',
[196] Fix | Delete
$update_data['counts']['themes'],
[197] Fix | Delete
number_format_i18n( $update_data['counts']['themes'] )
[198] Fix | Delete
);
[199] Fix | Delete
}
[200] Fix | Delete
[201] Fix | Delete
/* translators: %s: Number of available theme updates. */
[202] Fix | Delete
$submenu['themes.php'][5] = array( sprintf( __( 'Themes %s' ), $count ), $appearance_cap, 'themes.php' );
[203] Fix | Delete
[204] Fix | Delete
if ( wp_is_block_theme() ) {
[205] Fix | Delete
$submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' );
[206] Fix | Delete
} else {
[207] Fix | Delete
$submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?path=/patterns' );
[208] Fix | Delete
}
[209] Fix | Delete
[210] Fix | Delete
$customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
[211] Fix | Delete
[212] Fix | Delete
// Hide Customize link on block themes unless a plugin or theme
[213] Fix | Delete
// is using 'customize_register' to add a setting.
[214] Fix | Delete
if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) {
[215] Fix | Delete
$submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
[219] Fix | Delete
$submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' );
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize' ) ) {
[223] Fix | Delete
$customize_header_url = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url );
[224] Fix | Delete
$submenu['themes.php'][15] = array( _x( 'Header', 'custom image header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' );
[225] Fix | Delete
}
[226] Fix | Delete
[227] Fix | Delete
if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize' ) ) {
[228] Fix | Delete
$customize_background_url = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url );
[229] Fix | Delete
$submenu['themes.php'][20] = array( _x( 'Background', 'custom background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' );
[230] Fix | Delete
}
[231] Fix | Delete
[232] Fix | Delete
unset( $customize_url );
[233] Fix | Delete
[234] Fix | Delete
unset( $appearance_cap );
[235] Fix | Delete
[236] Fix | Delete
// Add 'Theme File Editor' to the bottom of the Appearance (non-block themes) or Tools (block themes) menu.
[237] Fix | Delete
if ( ! is_multisite() ) {
[238] Fix | Delete
// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook.
[239] Fix | Delete
add_action( 'admin_menu', '_add_themes_utility_last', 101 );
[240] Fix | Delete
}
[241] Fix | Delete
/**
[242] Fix | Delete
* Adds the 'Theme File Editor' menu item to the bottom of the Appearance (non-block themes)
[243] Fix | Delete
* or Tools (block themes) menu.
[244] Fix | Delete
*
[245] Fix | Delete
* @access private
[246] Fix | Delete
* @since 3.0.0
[247] Fix | Delete
* @since 5.9.0 Renamed 'Theme Editor' to 'Theme File Editor'.
[248] Fix | Delete
* Relocates to Tools for block themes.
[249] Fix | Delete
*/
[250] Fix | Delete
function _add_themes_utility_last() {
[251] Fix | Delete
add_submenu_page(
[252] Fix | Delete
wp_is_block_theme() ? 'tools.php' : 'themes.php',
[253] Fix | Delete
__( 'Theme File Editor' ),
[254] Fix | Delete
__( 'Theme File Editor' ),
[255] Fix | Delete
'edit_themes',
[256] Fix | Delete
'theme-editor.php'
[257] Fix | Delete
);
[258] Fix | Delete
}
[259] Fix | Delete
[260] Fix | Delete
/**
[261] Fix | Delete
* Adds the 'Plugin File Editor' menu item after the 'Themes File Editor' in Tools
[262] Fix | Delete
* for block themes.
[263] Fix | Delete
*
[264] Fix | Delete
* @access private
[265] Fix | Delete
* @since 5.9.0
[266] Fix | Delete
*/
[267] Fix | Delete
function _add_plugin_file_editor_to_tools() {
[268] Fix | Delete
if ( ! wp_is_block_theme() ) {
[269] Fix | Delete
return;
[270] Fix | Delete
}
[271] Fix | Delete
add_submenu_page(
[272] Fix | Delete
'tools.php',
[273] Fix | Delete
__( 'Plugin File Editor' ),
[274] Fix | Delete
__( 'Plugin File Editor' ),
[275] Fix | Delete
'edit_plugins',
[276] Fix | Delete
'plugin-editor.php'
[277] Fix | Delete
);
[278] Fix | Delete
}
[279] Fix | Delete
[280] Fix | Delete
$count = '';
[281] Fix | Delete
if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) {
[282] Fix | Delete
if ( ! isset( $update_data ) ) {
[283] Fix | Delete
$update_data = wp_get_update_data();
[284] Fix | Delete
}
[285] Fix | Delete
$count = sprintf(
[286] Fix | Delete
'<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
[287] Fix | Delete
$update_data['counts']['plugins'],
[288] Fix | Delete
number_format_i18n( $update_data['counts']['plugins'] )
[289] Fix | Delete
);
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
/* translators: %s: Number of available plugin updates. */
[293] Fix | Delete
$menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
[294] Fix | Delete
[295] Fix | Delete
$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' );
[296] Fix | Delete
[297] Fix | Delete
if ( ! is_multisite() ) {
[298] Fix | Delete
$submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 'plugin-install.php' );
[299] Fix | Delete
if ( wp_is_block_theme() ) {
[300] Fix | Delete
// Place the menu item below the Theme File Editor menu item.
[301] Fix | Delete
add_action( 'admin_menu', '_add_plugin_file_editor_to_tools', 101 );
[302] Fix | Delete
} else {
[303] Fix | Delete
$submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' );
[304] Fix | Delete
}
[305] Fix | Delete
}
[306] Fix | Delete
[307] Fix | Delete
unset( $update_data );
[308] Fix | Delete
[309] Fix | Delete
if ( current_user_can( 'list_users' ) ) {
[310] Fix | Delete
$menu[70] = array( __( 'Users' ), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
[311] Fix | Delete
} else {
[312] Fix | Delete
$menu[70] = array( __( 'Profile' ), 'read', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
[313] Fix | Delete
}
[314] Fix | Delete
[315] Fix | Delete
if ( current_user_can( 'list_users' ) ) {
[316] Fix | Delete
$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
[317] Fix | Delete
$submenu['users.php'][5] = array( __( 'All Users' ), 'list_users', 'users.php' );
[318] Fix | Delete
if ( current_user_can( 'create_users' ) ) {
[319] Fix | Delete
$submenu['users.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );
[320] Fix | Delete
} elseif ( is_multisite() ) {
[321] Fix | Delete
$submenu['users.php'][10] = array( __( 'Add New User' ), 'promote_users', 'user-new.php' );
[322] Fix | Delete
}
[323] Fix | Delete
[324] Fix | Delete
$submenu['users.php'][15] = array( __( 'Profile' ), 'read', 'profile.php' );
[325] Fix | Delete
} else {
[326] Fix | Delete
$_wp_real_parent_file['users.php'] = 'profile.php';
[327] Fix | Delete
$submenu['profile.php'][5] = array( __( 'Profile' ), 'read', 'profile.php' );
[328] Fix | Delete
if ( current_user_can( 'create_users' ) ) {
[329] Fix | Delete
$submenu['profile.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );
[330] Fix | Delete
} elseif ( is_multisite() ) {
[331] Fix | Delete
$submenu['profile.php'][10] = array( __( 'Add New User' ), 'promote_users', 'user-new.php' );
[332] Fix | Delete
}
[333] Fix | Delete
}
[334] Fix | Delete
[335] Fix | Delete
$site_health_count = '';
[336] Fix | Delete
if ( ! is_multisite() && current_user_can( 'view_site_health_checks' ) ) {
[337] Fix | Delete
$get_issues = get_transient( 'health-check-site-status-result' );
[338] Fix | Delete
[339] Fix | Delete
$issue_counts = array();
[340] Fix | Delete
[341] Fix | Delete
if ( false !== $get_issues ) {
[342] Fix | Delete
$issue_counts = json_decode( $get_issues, true );
[343] Fix | Delete
}
[344] Fix | Delete
[345] Fix | Delete
if ( ! is_array( $issue_counts ) || ! $issue_counts ) {
[346] Fix | Delete
$issue_counts = array(
[347] Fix | Delete
'good' => 0,
[348] Fix | Delete
'recommended' => 0,
[349] Fix | Delete
'critical' => 0,
[350] Fix | Delete
);
[351] Fix | Delete
}
[352] Fix | Delete
[353] Fix | Delete
$site_health_count = sprintf(
[354] Fix | Delete
'<span class="menu-counter site-health-counter count-%s"><span class="count">%s</span></span>',
[355] Fix | Delete
$issue_counts['critical'],
[356] Fix | Delete
number_format_i18n( $issue_counts['critical'] )
[357] Fix | Delete
);
[358] Fix | Delete
}
[359] Fix | Delete
[360] Fix | Delete
$menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' );
[361] Fix | Delete
$submenu['tools.php'][5] = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' );
[362] Fix | Delete
$submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' );
[363] Fix | Delete
$submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' );
[364] Fix | Delete
/* translators: %s: Number of critical Site Health checks. */
[365] Fix | Delete
$submenu['tools.php'][20] = array( sprintf( __( 'Site Health %s' ), $site_health_count ), 'view_site_health_checks', 'site-health.php' );
[366] Fix | Delete
$submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' );
[367] Fix | Delete
$submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' );
[368] Fix | Delete
if ( is_multisite() && ! is_main_site() ) {
[369] Fix | Delete
$submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' );
[370] Fix | Delete
}
[371] Fix | Delete
if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
[372] Fix | Delete
$submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' );
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
$menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
[376] Fix | Delete
$submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' );
[377] Fix | Delete
$submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' );
[378] Fix | Delete
$submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' );
[379] Fix | Delete
$submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' );
[380] Fix | Delete
$submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' );
[381] Fix | Delete
$submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' );
[382] Fix | Delete
$submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'options-privacy.php' );
[383] Fix | Delete
[384] Fix | Delete
$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group.
[385] Fix | Delete
[386] Fix | Delete
$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator' );
[387] Fix | Delete
[388] Fix | Delete
// Back-compat for old top-levels.
[389] Fix | Delete
$_wp_real_parent_file['post.php'] = 'edit.php';
[390] Fix | Delete
$_wp_real_parent_file['post-new.php'] = 'edit.php';
[391] Fix | Delete
$_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page';
[392] Fix | Delete
$_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page';
[393] Fix | Delete
$_wp_real_parent_file['wpmu-admin.php'] = 'tools.php';
[394] Fix | Delete
$_wp_real_parent_file['ms-admin.php'] = 'tools.php';
[395] Fix | Delete
[396] Fix | Delete
// Ensure backward compatibility.
[397] Fix | Delete
$compat = array(
[398] Fix | Delete
'index' => 'dashboard',
[399] Fix | Delete
'edit' => 'posts',
[400] Fix | Delete
'post' => 'posts',
[401] Fix | Delete
'upload' => 'media',
[402] Fix | Delete
'link-manager' => 'links',
[403] Fix | Delete
'edit-pages' => 'pages',
[404] Fix | Delete
'page' => 'pages',
[405] Fix | Delete
'edit-comments' => 'comments',
[406] Fix | Delete
'options-general' => 'settings',
[407] Fix | Delete
'themes' => 'appearance',
[408] Fix | Delete
);
[409] Fix | Delete
[410] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/menu.php';
[411] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function