WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
класс не описан

Yoast\WP\SEO\Actions\Indexing

Indexable_Prepare_Indexation_Action{} Yoast 1.0

Action for preparing the indexable indexation routine.

Хуков нет.

Возвращает

Null. Ничего.

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

$Indexable_Prepare_Indexation_Action = new Indexable_Prepare_Indexation_Action();
// use class methods

Методы

  1. __construct(
  2. prepare()

Код Indexable_Prepare_Indexation_Action{} Yoast 15.2

<?php
class Indexable_Prepare_Indexation_Action {

	/**
	 * The options helper.
	 *
	 * @var Options_Helper
	 */
	protected $options;

	/**
	 * The date helper.
	 *
	 * @var Date_Helper
	 */
	protected $date;

	/**
	 * The notification center.
	 *
	 * @var Yoast_Notification_Center
	 */
	protected $notification_center;

	/**
	 * Action for preparing the indexable indexation routine.
	 *
	 * @param Options_Helper            $options             The options helper.
	 * @param Date_Helper               $date                The date helper.
	 * @param Yoast_Notification_Center $notification_center The notification center.
	 */
	public function __construct(
		Options_Helper $options,
		Date_Helper $date,
		Yoast_Notification_Center $notification_center
	) {
		$this->options             = $options;
		$this->date                = $date;
		$this->notification_center = $notification_center;
	}

	/**
	 * Prepare the indexable indexation routine.
	 *
	 * @return void
	 */
	public function prepare() {
		$this->options->set( 'indexing_first_time', false );
		$this->options->set( 'indexation_started', $this->date->current_time() );

		$this->notification_center->remove_notification_by_id( Indexing_Notification_Integration::NOTIFICATION_ID );
	}
}