Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../public_h.../wp-conte.../plugins/wordpres.../admin/menu
File: class-admin-menu.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPSEO plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WPSEO\Admin\Menu
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Registers the admin menu on the left of the admin area.
[8] Fix | Delete
*/
[9] Fix | Delete
class WPSEO_Admin_Menu extends WPSEO_Base_Menu {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Registers all hooks to WordPress.
[13] Fix | Delete
*
[14] Fix | Delete
* @return void
[15] Fix | Delete
*/
[16] Fix | Delete
public function register_hooks() {
[17] Fix | Delete
// Needs the lower than default priority so other plugins can hook underneath it without issue.
[18] Fix | Delete
add_action( 'admin_menu', [ $this, 'register_settings_page' ], 5 );
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Registers the menu item submenus.
[23] Fix | Delete
*
[24] Fix | Delete
* @return void
[25] Fix | Delete
*/
[26] Fix | Delete
public function register_settings_page() {
[27] Fix | Delete
$manage_capability = $this->get_manage_capability();
[28] Fix | Delete
$page_identifier = $this->get_page_identifier();
[29] Fix | Delete
$admin_page_callback = $this->get_admin_page_callback();
[30] Fix | Delete
[31] Fix | Delete
// Get all submenu pages.
[32] Fix | Delete
$submenu_pages = $this->get_submenu_pages();
[33] Fix | Delete
[34] Fix | Delete
foreach ( $submenu_pages as $submenu_page ) {
[35] Fix | Delete
if ( WPSEO_Capability_Utils::current_user_can( $submenu_page[3] ) ) {
[36] Fix | Delete
$manage_capability = $submenu_page[3];
[37] Fix | Delete
$page_identifier = $submenu_page[4];
[38] Fix | Delete
$admin_page_callback = $submenu_page[5];
[39] Fix | Delete
break;
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
foreach ( $submenu_pages as $index => $submenu_page ) {
[44] Fix | Delete
$submenu_pages[ $index ][0] = $page_identifier;
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
/*
[48] Fix | Delete
* The current user has the capability to control anything.
[49] Fix | Delete
* This means that all submenus and dashboard can be shown.
[50] Fix | Delete
*/
[51] Fix | Delete
global $admin_page_hooks;
[52] Fix | Delete
[53] Fix | Delete
add_menu_page(
[54] Fix | Delete
'Yoast SEO: ' . __( 'Dashboard', 'wordpress-seo' ),
[55] Fix | Delete
'Yoast SEO ' . $this->get_notification_counter(),
[56] Fix | Delete
$manage_capability,
[57] Fix | Delete
$page_identifier,
[58] Fix | Delete
$admin_page_callback,
[59] Fix | Delete
$this->get_icon_svg(),
[60] Fix | Delete
99
[61] Fix | Delete
);
[62] Fix | Delete
[63] Fix | Delete
// Wipe notification bits from hooks.
[64] Fix | Delete
// phpcs:ignore WordPress.WP.GlobalVariablesOverride -- This is a deliberate action.
[65] Fix | Delete
$admin_page_hooks[ $page_identifier ] = 'seo';
[66] Fix | Delete
[67] Fix | Delete
// Add submenu items to the main menu if possible.
[68] Fix | Delete
$this->register_submenu_pages( $submenu_pages );
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
/**
[72] Fix | Delete
* Returns the list of registered submenu pages.
[73] Fix | Delete
*
[74] Fix | Delete
* @return array List of registered submenu pages.
[75] Fix | Delete
*/
[76] Fix | Delete
public function get_submenu_pages() {
[77] Fix | Delete
global $wpseo_admin;
[78] Fix | Delete
[79] Fix | Delete
$search_console_callback = null;
[80] Fix | Delete
[81] Fix | Delete
// Account for when the available submenu pages are requested from outside the admin.
[82] Fix | Delete
if ( isset( $wpseo_admin ) ) {
[83] Fix | Delete
$google_search_console = new WPSEO_GSC();
[84] Fix | Delete
$search_console_callback = [ $google_search_console, 'display' ];
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
// Submenu pages.
[88] Fix | Delete
$submenu_pages = [
[89] Fix | Delete
$this->get_submenu_page( __( 'General', 'wordpress-seo' ), $this->get_page_identifier() ),
[90] Fix | Delete
$this->get_submenu_page(
[91] Fix | Delete
__( 'Search Console', 'wordpress-seo' ),
[92] Fix | Delete
'wpseo_search_console',
[93] Fix | Delete
$search_console_callback
[94] Fix | Delete
),
[95] Fix | Delete
$this->get_submenu_page( __( 'Tools', 'wordpress-seo' ), 'wpseo_tools' ),
[96] Fix | Delete
$this->get_submenu_page( $this->get_license_page_title(), 'wpseo_licenses' ),
[97] Fix | Delete
];
[98] Fix | Delete
[99] Fix | Delete
/**
[100] Fix | Delete
* Filter: 'wpseo_submenu_pages' - Collects all submenus that need to be shown.
[101] Fix | Delete
*
[102] Fix | Delete
* @param array $submenu_pages List with all submenu pages.
[103] Fix | Delete
*/
[104] Fix | Delete
return (array) apply_filters( 'wpseo_submenu_pages', $submenu_pages );
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
/**
[108] Fix | Delete
* Returns the notification count in HTML format.
[109] Fix | Delete
*
[110] Fix | Delete
* @return string The notification count in HTML format.
[111] Fix | Delete
*/
[112] Fix | Delete
protected function get_notification_counter() {
[113] Fix | Delete
$notification_center = Yoast_Notification_Center::get();
[114] Fix | Delete
$notification_count = $notification_center->get_notification_count();
[115] Fix | Delete
[116] Fix | Delete
// Add main page.
[117] Fix | Delete
/* translators: Hidden accessibility text; %s: number of notifications. */
[118] Fix | Delete
$notifications = sprintf( _n( '%s notification', '%s notifications', $notification_count, 'wordpress-seo' ), number_format_i18n( $notification_count ) );
[119] Fix | Delete
[120] Fix | Delete
return sprintf( '<span class="update-plugins count-%1$d"><span class="plugin-count" aria-hidden="true">%1$d</span><span class="screen-reader-text">%2$s</span></span>', $notification_count, $notifications );
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* Returns the capability that is required to manage all options.
[125] Fix | Delete
*
[126] Fix | Delete
* @return string Capability to check against.
[127] Fix | Delete
*/
[128] Fix | Delete
protected function get_manage_capability() {
[129] Fix | Delete
return 'wpseo_manage_options';
[130] Fix | Delete
}
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function