WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WPSEO_Upgrade::clean_up_private_taxonomies_for_141() private Yoast 1.0

Cleans up the private taxonomies from the indexables table for the upgrade routine to 14.1.

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

Хуков нет.

Возвращает

null. Ничего.

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

// private - только в коде основоного (родительского) класса
$result = $this->clean_up_private_taxonomies_for_141();

Код WPSEO_Upgrade::clean_up_private_taxonomies_for_141() Yoast 17.3

public function clean_up_private_taxonomies_for_141() {
	global $wpdb;

	// If migrations haven't been completed successfully the following may give false errors. So suppress them.
	$show_errors       = $wpdb->show_errors;
	$wpdb->show_errors = false;

	// Clean up indexables of private taxonomies.
	$private_taxonomies = \get_taxonomies( [ 'public' => false ], 'names' );

	if ( empty( $private_taxonomies ) ) {
		return;
	}

	$indexable_table = Model::get_table_name( 'Indexable' );

	// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Reason: Is it prepared already.
	$query = $wpdb->prepare(
		// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: Too hard to fix.
		"DELETE FROM $indexable_table
		WHERE object_type = 'term'
		AND object_sub_type IN ("
			. \implode( ', ', \array_fill( 0, \count( $private_taxonomies ), '%s' ) )
			. ')',
		$private_taxonomies
	);
	$wpdb->query( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Reason: Is it prepared already.

	$wpdb->show_errors = $show_errors;
}