WPSEO_Admin_Bar_Menu::__construct
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_Asset_Manager $asset_manager, ?Indexable_Repository $indexable_repository, ?Score_Icon_Helper $score_icon_helper, ?Product_Helper $product_helper, ?WPSEO_Shortlinker $shortlinker );
- ?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
Код WPSEO_Admin_Bar_Menu::__construct() WPSEO Admin Bar Menu:: construct Yoast 28.3
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;
}