Yoast\WP\SEO\Abilities\Infrastructure\Global_Setting_Targets
Global_Setting_Target_Repository::__construct
Constructor.
The targets are listed instead of injected as a variadic, as the content type archive target implements the same interface but cannot be autowired.
Метод класса: Global_Setting_Target_Repository{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Global_Setting_Target_Repository = new Global_Setting_Target_Repository(); $Global_Setting_Target_Repository->__construct( $homepage, $author_archives, $date_archives, $search_page, $not_found_page, $post_type_archive_factory );
- $homepage(Homepage_Target) (обязательный)
- The homepage target.
- $author_archives(Author_Archives_Target) (обязательный)
- The author archives target.
- $date_archives(Date_Archives_Target) (обязательный)
- The date archives target.
- $search_page(Search_Page_Target) (обязательный)
- The search page target.
- $not_found_page(Not_Found_Page_Target) (обязательный)
- The 404 page target.
- $post_type_archive_factory(Post_Type_Archive_Target_Factory) (обязательный)
- The factory of the content type archive targets.
Код Global_Setting_Target_Repository::__construct() Global Setting Target Repository:: construct Yoast 28.9
public function __construct(
Homepage_Target $homepage,
Author_Archives_Target $author_archives,
Date_Archives_Target $date_archives,
Search_Page_Target $search_page,
Not_Found_Page_Target $not_found_page,
Post_Type_Archive_Target_Factory $post_type_archive_factory
) {
foreach ( [ $homepage, $author_archives, $date_archives, $search_page, $not_found_page ] as $target ) {
$this->single_targets[ $target->get_name() ] = $target;
}
$this->post_type_archive_factory = $post_type_archive_factory;
}