Yoast\WP\SEO\Routes

Indexables_Page_Route::restore_all_indexables()publicYoast 1.0

Restores all indexables from all ignore lists.

{} Это метод класса: Indexables_Page_Route{}

Хуков нет.

Возвращает

WP_REST_Response|WP_Error. The success or failure response.

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

$Indexables_Page_Route = new Indexables_Page_Route();
$Indexables_Page_Route->restore_all_indexables();

Код Indexables_Page_Route::restore_all_indexables() Yoast 19.10

public function restore_all_indexables() {
	$list_names = $this->indexables_page_helper->get_ignore_list_names();
	$success    = true;
	foreach ( $list_names as $list_name ) {
		$result = $this->indexables_page_action->remove_all_indexables_from_ignore_list( $list_name );

		if ( $result === false ) {
			$success = false;
		}
	}

	if ( $success === true ) {
		return new WP_REST_Response(
			[
				'json' => (object) [ 'success' => true ],
			],
			200
		);
	}

	return new WP_Error(
		'restore_all_failed',
		'Could not save the option in the database',
		[
			'status' => 500,
		]
	);
}