Automattic\WooCommerce\Internal\Fulfillments
FulfillmentsController::initialize_fulfillments
Initialize the fulfillments controller.
Method of the class: FulfillmentsController{}
No Hooks.
Returns
null. Nothing (null).
Usage
$FulfillmentsController = new FulfillmentsController(); $FulfillmentsController->initialize_fulfillments();
FulfillmentsController::initialize_fulfillments() FulfillmentsController::initialize fulfillments code WC 10.3.3
public function initialize_fulfillments() {
$container = wc_get_container();
$features_controller = $container->get( FeaturesController::class );
// If fulfillments feature is not enabled, do not add the DB tables, and don't register the controller.
if ( ! $features_controller->feature_is_enabled( 'fulfillments' ) ) {
return;
}
// Create the database tables if they do not exist.
$this->maybe_create_db_tables();
// Register the classes that this controller provides.
foreach ( $this->provides as $class ) {
$class = $container->get( $class );
if ( method_exists( $class, 'register' ) ) {
$class->register();
}
}
}