ActionScheduler_Abstract_Schema::register_tables()
Register tables with WordPress, and create them if needed.
Method of the class: ActionScheduler_Abstract_Schema{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$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.
Default: false
ActionScheduler_Abstract_Schema::register_tables() ActionScheduler Abstract Schema::register tables code WC 9.6.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(); } }