WPSEO_Admin_Bar_Menu::__construct()publicYoast 1.0

Constructs the WPSEO_Admin_Bar_Menu.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$WPSEO_Admin_Bar_Menu = new WPSEO_Admin_Bar_Menu();
$WPSEO_Admin_Bar_Menu->__construct(;

Код WPSEO_Admin_Bar_Menu::__construct() Yoast 22.4

public function __construct(
	?WPSEO_Admin_Asset_Manager $asset_manager = null,
	?Indexable_Repository $indexable_repository = null,
	?Score_Icon_Helper $score_icon_helper = null,
	?Product_Helper $product_helper = null,
	?WPSEO_Shortlinker $shortlinker = null
) {
	if ( ! $asset_manager ) {
		$asset_manager = new WPSEO_Admin_Asset_Manager();
	}
	if ( ! $indexable_repository ) {
		$indexable_repository = YoastSEO()->classes->get( Indexable_Repository::class );
	}
	if ( ! $score_icon_helper ) {
		$score_icon_helper = YoastSEO()->helpers->score_icon;
	}
	if ( ! $product_helper ) {
		$product_helper = YoastSEO()->helpers->product;
	}
	if ( ! $shortlinker ) {
		$shortlinker = new WPSEO_Shortlinker();
	}

	$this->product_helper       = $product_helper;
	$this->asset_manager        = $asset_manager;
	$this->indexable_repository = $indexable_repository;
	$this->score_icon_helper    = $score_icon_helper;
	$this->shortlinker          = $shortlinker;
}