ActionScheduler_Abstract_Schema::register_tables
Register tables with WordPress, and create them if needed.
Метод класса: ActionScheduler_Abstract_Schema{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
$ActionScheduler_Abstract_Schema = new ActionScheduler_Abstract_Schema(); $ActionScheduler_Abstract_Schema->register_tables( $force_update );
- $force_update(true|false)
- Use true to always run the schema update.
По умолчанию:false
Код ActionScheduler_Abstract_Schema::register_tables() ActionScheduler Abstract Schema::register tables WC 10.7.0
public function register_tables( $force_update = false ) {
global $wpdb;
// make WP aware of our tables.
foreach ( $this->tables as $table ) {
$wpdb->tables[] = $table;
$name = $this->get_full_table_name( $table );
$wpdb->$table = $name;
}
// create the tables.
if ( $this->schema_update_required() || $force_update ) {
foreach ( $this->tables as $table ) {
/**
* Allow custom processing before updating a table schema.
*
* @param string $table Name of table being updated.
* @param string $db_version Existing version of the table being updated.
*/
do_action( 'action_scheduler_before_schema_update', $table, $this->db_version );
$this->update_table( $table );
}
$this->mark_schema_update_complete();
}
}