WPSEO_Admin_Bar_Menu::add_get_help_submenu()protectedYoast 1.0

Adds the admin bar How To submenu.

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

Хуков нет.

Возвращает

null. Ничего.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_get_help_submenu( $wp_admin_bar );
$wp_admin_bar(WP_Admin_Bar) (обязательный)
Admin bar instance to add the menu to.

Код WPSEO_Admin_Bar_Menu::add_get_help_submenu() Yoast 20.0

protected function add_get_help_submenu( WP_Admin_Bar $wp_admin_bar ) {
	$menu_args = [
		'parent' => self::MENU_IDENTIFIER,
		'id'     => 'wpseo-sub-get-help',
		'title'  => __( 'Help', 'wordpress-seo' ),
		'meta'   => [ 'tabindex' => '0' ],
	];
	$wp_admin_bar->add_menu( $menu_args );

	$submenu_items = [
		[
			'id'    => 'wpseo-yoast-help',
			'title' => __( 'Yoast.com help section', 'wordpress-seo' ),
			'href'  => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-yoast-help' ),
		],
		[
			'id'    => 'wpseo-premium-support',
			'title' => __( 'Yoast Premium support', 'wordpress-seo' ),
			'href'  => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-premium-support' ),
		],
		[
			'id'    => 'wpseo-wp-support-forums',
			'title' => __( 'WordPress.org support forums', 'wordpress-seo' ),
			'href'  => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-wp-support-forums' ),
		],
		[
			'id'    => 'wpseo-learn-seo-2',
			'title' => __( 'Learn more SEO', 'wordpress-seo' ),
			'href'  => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-learn-more-seo-help' ),
		],
	];

	$this->add_submenu_items( $submenu_items, $wp_admin_bar, 'wpseo-sub-get-help' );
}