WPSEO_Import_WPSEO::detect
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() WPSEO Import WPSEO::detect Yoast 26.9
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;
}