<?php /** * Provider for initializing the LearnDash Core plugin. * * @since 4.6.0 * * @package LearnDash\Core */ namespace LearnDash\Core; use StellarWP\Learndash\lucatume\DI52\ContainerException; use StellarWP\Learndash\lucatume\DI52\ServiceProvider; use StellarWP\Learndash\StellarWP\Assets\Asset; /** * Class Provider for the LearnDash Core. * * @since 4.6.0 */ class Provider extends ServiceProvider { /** * Registers the service provider bindings. * * @since 4.6.0 * * @throws ContainerException If the registration fails. * * @return void */ public function register(): void { // Registering implementations. $this->container->register( Libraries\Provider::class ); $this->register_actions(); $this->container->register( Licensing\Provider::class ); $this->container->register( Settings\Provider::class ); $this->container->register( Modules\Provider::class ); $this->container->register( Payments\Provider::class ); // TODO: Move to modules one day. $this->container->register( Infrastructure\Provider::class ); // Registering in-progress features. // bail early if in-progress features are not enabled. if ( ! defined( 'LEARNDASH_ENABLE_IN_PROGRESS_FEATURES' ) || ! LEARNDASH_ENABLE_IN_PROGRESS_FEATURES ) { // @phpstan-ignore-line -- constant can be changed. return; } // Breezy template. if ( defined( 'LEARNDASH_ENABLE_FEATURE_BREEZY_TEMPLATE' ) && LEARNDASH_ENABLE_FEATURE_BREEZY_TEMPLATE ) { // @phpstan-ignore-line -- constant can be changed. $this->container->register( Themes\Provider::class ); } } /** * Register actions. * * @since 4.16.0 * * @return void */ public function register_actions(): void { add_action( 'init', [ $this, 'register_scripts' ], 1 ); } /** * Registers the core LearnDash scripts that can be enqueued. * * These are global-level, core scripts that are used throughout the plugin. * * @since 4.16.0 * * @return void */ public function register_scripts(): void { Asset::add( 'learndash-main', 'js/main.js' ) ->add_to_group( 'learndash-core' ) ->register(); Asset::add( 'learndash-breakpoints', 'js/breakpoints.js' ) ->add_to_group( 'learndash-core' ) ->set_dependencies( 'learndash-main' ) ->register(); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
API | Folder | 0755 |
|
|
Collections | Folder | 0755 |
|
|
Factories | Folder | 0755 |
|
|
Infrastructure | Folder | 0755 |
|
|
Libraries | Folder | 0755 |
|
|
Licensing | Folder | 0755 |
|
|
Mappers | Folder | 0755 |
|
|
Models | Folder | 0755 |
|
|
Modules | Folder | 0755 |
|
|
Payments | Folder | 0755 |
|
|
Services | Folder | 0755 |
|
|
Settings | Folder | 0755 |
|
|
Shortcodes | Folder | 0755 |
|
|
Template | Folder | 0755 |
|
|
Themes | Folder | 0755 |
|
|
Traits | Folder | 0755 |
|
|
Utilities | Folder | 0755 |
|
|
Validations | Folder | 0755 |
|
|
App.php | File | 1.5 KB | 0644 |
|
Autoloader.php | File | 9.44 KB | 0644 |
|
Container.php | File | 4.51 KB | 0644 |
|
Provider.php | File | 2.22 KB | 0644 |
|