ActionScheduler_WPCLI_Scheduler_command::fix_schema
Force tables schema creation for Action Scheduler
OPTIONS
Method of the class: ActionScheduler_WPCLI_Scheduler_command{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ActionScheduler_WPCLI_Scheduler_command = new ActionScheduler_WPCLI_Scheduler_command(); $ActionScheduler_WPCLI_Scheduler_command->fix_schema( $args, $assoc_args );
- $args(array) (required)
- Positional arguments.
- $assoc_args(array) (required)
- Keyed arguments.
ActionScheduler_WPCLI_Scheduler_command::fix_schema() ActionScheduler WPCLI Scheduler command::fix schema code WC 10.3.3
public function fix_schema( $args, $assoc_args ) {
$schema_classes = array( ActionScheduler_LoggerSchema::class, ActionScheduler_StoreSchema::class );
foreach ( $schema_classes as $classname ) {
if ( is_subclass_of( $classname, ActionScheduler_Abstract_Schema::class ) ) {
$obj = new $classname();
$obj->init();
$obj->register_tables( true );
WP_CLI::success(
sprintf(
/* translators: %s refers to the schema name*/
__( 'Registered schema for %s', 'woocommerce' ),
$classname
)
);
}
}
}