Submit
Path:
~
/
home
/
getwphos
/
www
/
twinkletown
/
wp-content
/
plugins
/
wgl-extensions
/
includes
/
elementor
/
controls
/
File Content:
wgl_icon.php
<?php namespace WGL_Extensions\Controls; defined('ABSPATH') || exit; use Elementor\Base_Data_Control; use WGL_Extensions\Includes\WGL_Elementor_Helper; /** * WGL Elementor Custom Icon Control * * * @package wgl-extensions\includes\elementor * @author WebGeniusLab <webgeniuslab@gmail.com> * @since 1.0.0 */ class WGL_Icon extends Base_Data_Control { /** * Get radio image control type. * * Retrieve the control type, in this case `radio-image`. * * @since 1.0.0 * @access public * * @return string Control type. */ public function get_type() { return 'wgl-icon'; } public function enqueue() { // Scripts wp_enqueue_script( 'wgl-elementor-extensions', WGL_EXTENSIONS_ELEMENTOR_URL . 'assets/js/wgl_elementor_extenstions.js'); // Style wp_enqueue_style( 'wgl-elementor-extensions', WGL_EXTENSIONS_ELEMENTOR_URL . 'assets/css/wgl_elementor_extenstions.css'); } public static function get_icons() { $array = WGL_Elementor_Helper::get_instance()->get_wgl_icons(); $new_array = []; foreach ($array as $key => $value) { $new_array[apply_filters('wgl_ext_icons', 'flaticon') . '-' .$value] = $value; } return $new_array; } /** * Get radio image control default settings. * * * @since 1.0.0 * @access protected * * @return array Control default settings. */ protected function get_default_settings() { return [ 'label_block' => true, 'options' => self::get_icons(), 'include' => '', 'exclude' => '', 'select2options' => [], ]; } /** * Render radio image control output in the editor. * * Used to generate the control HTML in the editor using Underscore JS * template. The variables for the class are available using `data` JS * object. * * @since 1.0.0 * @access public */ public function content_template() { $control_uid = $this->get_control_uid(); ?> <div class="elementor-control-field"> <# if ( data.label ) {#> <label for="<?php echo $control_uid; ?>" class="elementor-control-title">{{{ data.label }}}</label> <# } #> <div class="elementor-control-input-wrapper"> <select id="<?php echo $control_uid; ?>" class="elementor-control-icon elementor-select2" type="select2" data-setting="{{ data.name }}" data-placeholder="<?php echo __( 'Select Icon', 'wgl-extensions' ); ?>"> <# _.each( data.options, function( option_title, option_value ) { var value = data.controlValue; if ( typeof value == 'string' ) { var selected = ( option_value === value ) ? 'selected' : ''; } else if ( null !== value ) { var value = _.values( value ); var selected = ( -1 !== value.indexOf( option_value ) ) ? 'selected' : ''; } #> <option {{ selected }} value="{{ option_value }}">{{{ option_title }}}</option> <# } ); #> </select> </div> </div> <# if ( data.description ) { #> <div class="elementor-control-field-description">{{{ data.description }}}</div> <# } #> <?php } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
wgl_icon.php
3567 bytes
0644
wgl_radio_image.php
2780 bytes
0644
N4ST4R_ID | Naxtarrr