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


Adapter::table_exists() public Yoast 1.0

Checks if a table exists.

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

Хуков нет.




$Adapter = new Adapter();
$Adapter->table_exists( $table );
$table(строка) (обязательный)
The table name.

Код Adapter::table_exists() Yoast 17.1

public function table_exists( $table ) {
	global $wpdb;

	// We need last error to be clear so we can check against it easily.
	$previous_last_error      = $wpdb->last_error;
	$previous_suppress_errors = $wpdb->suppress_errors;
	$wpdb->last_error         = '';
	$wpdb->suppress_errors    = true;

	$result = $wpdb->query( "SELECT * FROM $table LIMIT 1" );

	// Restore the last error, as this is not truly an error and we don't want to alarm people.
	$wpdb->last_error      = $previous_last_error;
	$wpdb->suppress_errors = $previous_suppress_errors;

	return $result !== false;