load-standalone-dependencies.php
42 lines
| 1 | <?php |
| 2 | |
| 3 | define( 'WCML_WPML_DEPENDENCY_URL', WCML_PLUGIN_URL . '/addons/wpml-dependencies/lib' ); |
| 4 | |
| 5 | require_once WCML_PLUGIN_PATH . '/addons/wpml-dependencies/vendor/autoload.php'; |
| 6 | require_once WCML_PLUGIN_PATH . '/addons/wpml-dependencies/lib/missing-functions.php'; |
| 7 | |
| 8 | $setPartialDicConfigFromCore = function() { |
| 9 | \WPML\Container\share( \WCML\StandAlone\Container\Config::getSharedInstances() ); |
| 10 | \WPML\Container\share( \WCML\StandAlone\Container\Config::getSharedClasses() ); |
| 11 | \WPML\Container\alias( \WCML\StandAlone\Container\Config::getAliases() ); |
| 12 | \WPML\Container\delegate( \WCML\StandAlone\Container\Config::getDelegated() ); |
| 13 | }; |
| 14 | |
| 15 | $setPartialDicConfigFromCore(); |
| 16 | |
| 17 | if ( is_admin() ) { |
| 18 | require_once WCML_PLUGIN_PATH . '/addons/wpml-dependencies/lib/inc/icl-admin-notifier.php'; |
| 19 | |
| 20 | $loadOtgsIconsStyles = function() { |
| 21 | $vendor_root_url = WCML_PLUGIN_URL . '/vendor'; |
| 22 | require_once WCML_PLUGIN_PATH . '/vendor/otgs/icons/loader.php'; |
| 23 | |
| 24 | add_action( 'admin_init', |
| 25 | function() { |
| 26 | wp_enqueue_style( OTGS_ASSETS_ICONS_STYLES ); |
| 27 | }, |
| 28 | PHP_INT_MAX |
| 29 | ); |
| 30 | }; |
| 31 | |
| 32 | $loadOtgsIconsStyles(); |
| 33 | |
| 34 | ( new \WCML\StandAlone\DependencyAssets( WCML_WPML_DEPENDENCY_URL ) )->add_hooks(); |
| 35 | |
| 36 | wcml_wpml_get_admin_notices(); |
| 37 | |
| 38 | ( new WPML_Action_Filter_Loader() )->load( [ |
| 39 | \WPML\Notices\DismissNotices::class, |
| 40 | ] ); |
| 41 | } |
| 42 |