ActionScheduler_WPCLI_Scheduler_command::fix_schema()publicWC 1.0

Force tables schema creation for Action Scheduler

OPTIONS

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

Хуков нет.

Возвращает

null. Ничего.

Использование

$ActionScheduler_WPCLI_Scheduler_command = new ActionScheduler_WPCLI_Scheduler_command();
$ActionScheduler_WPCLI_Scheduler_command->fix_schema( $args, $assoc_args );
$args(массив) (обязательный)
Positional arguments.
$assoc_args(массив) (обязательный)
Keyed arguments.

Код ActionScheduler_WPCLI_Scheduler_command::fix_schema() WC 6.9.4

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
				)
			);
		}
	}
}