Yoast\WP\SEO\Routes

Indexing_Route::run_indexation_action()protectedYoast 1.0

Runs an indexing action and returns the response.

Метод класса: Indexing_Route{}

Хуков нет.

Возвращает

WP_REST_Response|WP_Error. The response, or an error when running the indexing action failed.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->run_indexation_action( $indexation_action, $url );
$indexation_action(Indexation_Action_Interface) (обязательный)
The indexing action.
$url(строка) (обязательный)
The url of the indexing route.

Код Indexing_Route::run_indexation_action() Yoast 22.4

protected function run_indexation_action( Indexation_Action_Interface $indexation_action, $url ) {
	try {
		return parent::run_indexation_action( $indexation_action, $url );
	} catch ( Exception $exception ) {
		$this->indexing_helper->indexing_failed();

		return new WP_Error(
			'wpseo_error_indexing',
			$exception->getMessage(),
			[ 'stackTrace' => $exception->getTraceAsString() ]
		);
	}
}