Plugin Directory

Changeset 2297663


Ignore:
Timestamp:
05/04/2020 11:38:52 AM (6 years ago)
Author:
nimeshrmr
Message:

Fix issue in new version

Location:
ultimate-elements-elementor-page-builder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ultimate-elements-elementor-page-builder/tags/2.0/ultimate-elements-elementor-page-builder.php

    r2297654 r2297663  
    6666        add_action( 'elementor/widgets/widgets_registered', array( $this, 'widgets_registered' ) );
    6767
    68        
     68        add_action( 'elementor/controls/controls_registered', array( $this, 'register_controls' ) );
    6969        add_action( 'elementor/document/before_save', array( $this, 'elementor_save_data' ) , 10 ,2 );
    7070
     
    7474         
    7575        wp_register_style('ueepb-front-style', UEEPB_PLUGIN_URL . 'css/ueepb-front.css');
    76        
     76        wp_enqueue_style( 'ueepb-front-style' );
    7777
    7878        wp_register_script('ueepb-front', UEEPB_PLUGIN_URL.'js/ueepb-front.js', array('jquery'));
     
    279279           
    280280        }
    281     }   
     281    }   
     282
     283    public function register_controls() {
     284
     285        $control_files = array('ueepb-select2-control.php' );
     286
     287        foreach ($control_files as $control_file_item) {
     288            $control_file = plugin_dir_path(__FILE__).'controls/'.$control_file_item;
     289            $template_file = locate_template($control_file);
     290            if ( !$template_file || !is_readable( $template_file ) ) {
     291                $template_file = plugin_dir_path(__FILE__).'controls/'.$control_file_item;
     292            }
     293
     294            if ( $template_file && is_readable( $template_file ) ) {
     295                require_once $template_file;
     296            }
     297        }
     298
     299        $controls_manager = \Elementor\Plugin::$instance->controls_manager;
     300        $controls_manager->register_control( 'ueepb_select2', new UEEPB_Select2() );
     301
     302    }
    282303
    283304    public function elementor_save_data($document,$data) { }
  • ultimate-elements-elementor-page-builder/trunk/ultimate-elements-elementor-page-builder.php

    r2297654 r2297663  
    6666        add_action( 'elementor/widgets/widgets_registered', array( $this, 'widgets_registered' ) );
    6767
    68        
     68        add_action( 'elementor/controls/controls_registered', array( $this, 'register_controls' ) );
    6969        add_action( 'elementor/document/before_save', array( $this, 'elementor_save_data' ) , 10 ,2 );
    7070
     
    7474         
    7575        wp_register_style('ueepb-front-style', UEEPB_PLUGIN_URL . 'css/ueepb-front.css');
    76        
     76        wp_enqueue_style( 'ueepb-front-style' );
    7777
    7878        wp_register_script('ueepb-front', UEEPB_PLUGIN_URL.'js/ueepb-front.js', array('jquery'));
     
    279279           
    280280        }
    281     }   
     281    }   
     282
     283    public function register_controls() {
     284
     285        $control_files = array('ueepb-select2-control.php' );
     286
     287        foreach ($control_files as $control_file_item) {
     288            $control_file = plugin_dir_path(__FILE__).'controls/'.$control_file_item;
     289            $template_file = locate_template($control_file);
     290            if ( !$template_file || !is_readable( $template_file ) ) {
     291                $template_file = plugin_dir_path(__FILE__).'controls/'.$control_file_item;
     292            }
     293
     294            if ( $template_file && is_readable( $template_file ) ) {
     295                require_once $template_file;
     296            }
     297        }
     298
     299        $controls_manager = \Elementor\Plugin::$instance->controls_manager;
     300        $controls_manager->register_control( 'ueepb_select2', new UEEPB_Select2() );
     301
     302    }
    282303
    283304    public function elementor_save_data($document,$data) { }
Note: See TracChangeset for help on using the changeset viewer.