e_name( $table ) {
return $GLOBALS['wpdb']->prefix . $table;
}
/**
* Confirms that all of the tables registered by this schema class have been created.
*
* @return bool
*/
public function tables_exist() {
global $wpdb;
$tables_exist = true;
foreach ( $this->tables as $table_name ) {
$table_name = $wpdb->prefix . $table_name;
$pattern = str_replace( '_', '\\_', $table_name );
$existing_table = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $pattern ) );
if ( $existing_table !== $table_name ) {
$tables_exist = false;
break;
}
}
return $tables_exist;
}
}