Yoast\WP\SEO\Commands
Index_Command::run_indexation_actions() protected Yoast 1.0
Runs all indexation actions.
{} Это метод класса: Index_Command{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->run_indexation_actions( $assoc_args );
- $assoc_args(массив) (обязательный)
- The associative arguments.
Код Index_Command::run_indexation_actions() Index Command::run indexation actions Yoast 16.1.1
protected function run_indexation_actions( $assoc_args ) {
// See if we need to clear all indexables before repopulating.
if ( isset( $assoc_args['reindex'] ) ) {
// Argument --skip-confirmation to prevent confirmation (for automated systems).
if ( ! isset( $assoc_args['skip-confirmation'] ) ) {
WP_CLI::confirm( 'This will clear all previously indexed objects. Are you certain you wish to proceed?' );
}
// Truncate the tables.
$this->clear();
// Delete the transients to make sure re-indexing runs every time.
\delete_transient( Indexable_Post_Indexation_Action::TRANSIENT_CACHE_KEY );
\delete_transient( Indexable_Post_Type_Archive_Indexation_Action::TRANSIENT_CACHE_KEY );
\delete_transient( Indexable_Term_Indexation_Action::TRANSIENT_CACHE_KEY );
}
$indexation_actions = [
'posts' => $this->post_indexation_action,
'terms' => $this->term_indexation_action,
'post type archives' => $this->post_type_archive_indexation_action,
'general objects' => $this->general_indexation_action,
];
$this->prepare_indexing_action->prepare();
foreach ( $indexation_actions as $name => $indexation_action ) {
$this->run_indexation_action( $name, $indexation_action );
}
$this->complete_indexation_action->complete();
}