WPSEO_Import_WPSEO::detect()protectedYoast 1.0

Detects whether there is post meta data to import.

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

Хуков нет.

Возвращает

true|false. Boolean indicating whether there is something to import.

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

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

Код WPSEO_Import_WPSEO::detect() Yoast 22.3

protected function detect() {
	if ( parent::detect() ) {
		return true;
	}

	global $wpdb;
	$count = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->options} WHERE option_name LIKE 'wpseo_category_%'" );
	if ( $count !== '0' ) {
		return true;
	}

	return false;
}