WPSEO_Admin_Menu::get_submenu_pages()publicYoast 1.0

Returns the list of registered submenu pages.

Метод класса: WPSEO_Admin_Menu{}

Хуки из метода

Возвращает

Массив. List of registered submenu pages.

Использование

$WPSEO_Admin_Menu = new WPSEO_Admin_Menu();
$WPSEO_Admin_Menu->get_submenu_pages();

Код WPSEO_Admin_Menu::get_submenu_pages() Yoast 24.0

public function get_submenu_pages() {
	global $wpseo_admin;

	$search_console_callback = null;

	// Account for when the available submenu pages are requested from outside the admin.
	if ( isset( $wpseo_admin ) ) {
		$google_search_console   = new WPSEO_GSC();
		$search_console_callback = [ $google_search_console, 'display' ];
	}

	// Submenu pages.
	$submenu_pages = [
		$this->get_submenu_page(
			__( 'Search Console', 'wordpress-seo' ),
			'wpseo_search_console',
			$search_console_callback
		),
		$this->get_submenu_page( __( 'Tools', 'wordpress-seo' ), 'wpseo_tools' ),
		$this->get_submenu_page( $this->get_license_page_title(), 'wpseo_licenses' ),
	];

	/**
	 * Filter: 'wpseo_submenu_pages' - Collects all submenus that need to be shown.
	 *
	 * @param array $submenu_pages List with all submenu pages.
	 */
	return (array) apply_filters( 'wpseo_submenu_pages', $submenu_pages );
}