Yoast\WP\SEO\Actions\Importing\Aioseo

Aioseo_Cleanup_Action::truncate_query()publicYoast 1.0

Creates a TRUNCATE query string for emptying the AIOSEO indexable table, if it exists.

{} Это метод класса: 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->truncate_query();

Код Aioseo_Cleanup_Action::truncate_query() Yoast 19.2

public function truncate_query() {
	if ( ! $this->aioseo_helper->aioseo_exists() ) {
		// If the table doesn't exist, we need a string that will amount to a quick query that doesn't return false when ran.
		return 'SELECT 1';
	}

	$table = $this->aioseo_helper->get_table();

	return "TRUNCATE TABLE {$table}";
}