Yoast\WP\SEO\Actions\Importing\Aioseo

Aioseo_Cleanup_Action::cleanup_postmeta_query()publicYoast 1.0

Creates a DELETE query string for deleting AIOSEO postmeta data.

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

Хуков нет.

Возвращает

Строку. The query to use for importing or counting the number of items to import.

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

$Aioseo_Cleanup_Action = new Aioseo_Cleanup_Action();
$Aioseo_Cleanup_Action->cleanup_postmeta_query();

Код Aioseo_Cleanup_Action::cleanup_postmeta_query() Yoast 22.4

public function cleanup_postmeta_query() {
	$table               = $this->get_postmeta_table();
	$meta_keys_to_delete = $this->aioseo_postmeta_keys;

	// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input.
	return $this->wpdb->prepare(
		"DELETE FROM {$table} WHERE meta_key IN (" . \implode( ', ', \array_fill( 0, \count( $meta_keys_to_delete ), '%s' ) ) . ')',
		$meta_keys_to_delete
	);
	// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
}