Yoast\WP\SEO\Abilities\Infrastructure\Global_Setting_Targets
Author_Archives_Target{}└─ Abstract_Global_Setting_Target
The author archives, which share one template.
Хуков нет.
Использование
$Author_Archives_Target = new Author_Archives_Target(); // use class methods
Методы
- public __construct( Author_Archive_Helper $author_archive_helper )
- public get_name()
- public is_enabled()
- public is_shared()
Код Author_Archives_Target{} Author Archives Target{} Yoast 28.9
class Author_Archives_Target extends Abstract_Global_Setting_Target {
/**
* The name of the target.
*
* @var string
*/
public const NAME = 'author_archives';
/**
* The author archive helper.
*
* @var Author_Archive_Helper
*/
private $author_archive_helper;
/**
* Constructor.
*
* @param Author_Archive_Helper $author_archive_helper The author archive helper.
*/
public function __construct( Author_Archive_Helper $author_archive_helper ) {
$this->author_archive_helper = $author_archive_helper;
}
/**
* Returns the name of the target.
*
* @return string The name.
*/
public function get_name(): string {
return self::NAME;
}
/**
* Returns that the author archives share one template.
*
* @return bool Whether the template is shared.
*/
public function is_shared(): bool {
return true;
}
/**
* Returns whether the author archives are enabled.
*
* @return bool Whether the target is enabled.
*/
public function is_enabled(): bool {
return ! $this->author_archive_helper->are_disabled();
}
}