Factory.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Multicurrency\UI; |
| 4 | |
| 5 | use WCML\StandAlone\IStandAloneAction; |
| 6 | |
| 7 | use WCML\Utilities\AdminPages; |
| 8 | use function WPML\Container\make; |
| 9 | |
| 10 | class Factory implements \IWPML_Backend_Action_Loader, \IWPML_Deferred_Action_Loader, IStandAloneAction { |
| 11 | |
| 12 | public function get_load_action() { |
| 13 | return 'init'; |
| 14 | } |
| 15 | |
| 16 | public function create() { |
| 17 | global $woocommerce_wpml; |
| 18 | |
| 19 | if ( AdminPages::isMultiCurrency() && make( \WCML_Dependencies::class )->check() ) { |
| 20 | return make( |
| 21 | Hooks::class, |
| 22 | [ |
| 23 | ':wcmlSettings' => $woocommerce_wpml->settings, |
| 24 | ] |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | return null; |
| 29 | } |
| 30 | } |
| 31 |