Yoast\WP\SEO\Builders
Indexable_Date_Archive_Builder{} Yoast 1.0
Date Archive Builder for the indexables.
Formats the date archive meta to indexable format.
Хуков нет.
Возвращает
Null. Ничего.
Использование
$Indexable_Date_Archive_Builder = new Indexable_Date_Archive_Builder(); // use class methods
Методы
Код Indexable_Date_Archive_Builder{} Indexable Date Archive Builder{} Yoast 15.6.2
class Indexable_Date_Archive_Builder {
/**
* The options helper.
*
* @var Options_Helper
*/
private $options;
/**
* Indexable_Date_Archive_Builder constructor.
*
* @param Options_Helper $options The options helper.
*/
public function __construct(
Options_Helper $options
) {
$this->options = $options;
}
/**
* Formats the data.
*
* @param Indexable $indexable The indexable to format.
*
* @return Indexable The extended indexable.
*/
public function build( $indexable ) {
$indexable->object_type = 'date-archive';
$indexable->title = $this->options->get( 'title-archive-wpseo' );
$indexable->description = $this->options->get( 'metadesc-archive-wpseo' );
$indexable->is_robots_noindex = $this->options->get( 'noindex-archive-wpseo' );
$indexable->is_public = ( (int) $indexable->is_robots_noindex !== 1 );
$indexable->blog_id = \get_current_blog_id();
return $indexable;
}
}