balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

module.php (976B)


      1 <?php
      2 namespace Elementor\Modules\DevTools;
      3 
      4 use Elementor\Core\Base\Module as BaseModule;
      5 
      6 if ( ! defined( 'ABSPATH' ) ) {
      7 	exit; // Exit if accessed directly.
      8 }
      9 
     10 /**
     11  * Fix issue with 'Potentially polymorphic call. The code may be inoperable depending on the actual class instance passed as the argument.'.
     12  * Its tells to the editor that instance() return right module. instead of base module.
     13  * @method Module instance()
     14 */
     15 class Module extends BaseModule {
     16 	/**
     17 	 * @var Deprecation
     18 	 */
     19 	public $deprecation;
     20 
     21 	public function __construct() {
     22 		$this->deprecation = new Deprecation( ELEMENTOR_VERSION );
     23 
     24 		add_filter( 'elementor/editor/localize_settings', [ $this, 'localize_settings' ] );
     25 	}
     26 
     27 	public function get_name() {
     28 		return 'dev-tools';
     29 	}
     30 
     31 	public function localize_settings( $settings ) {
     32 		$settings = array_replace_recursive( $settings, [
     33 			'dev_tools' => [
     34 				'deprecation' => $this->deprecation->get_settings(),
     35 			],
     36 		] );
     37 
     38 		return $settings;
     39 	}
     40 }