PK,v\>pr r class-wp-widget-search.phpnuW+A 'widget_search', 'description' => __( 'A search form for your site.' ), 'customize_selective_refresh' => true, ); parent::__construct( 'search', _x( 'Search', 'Search widget' ), $widget_ops ); } /** * Outputs the content for the current Search widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Search widget instance. */ public function widget( $args, $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } // Use current theme search form if it exists. get_search_form(); echo $args['after_widget']; } /** * Outputs the settings form for the Search widget. * * @since 2.8.0 * * @param array $instance Current settings. */ public function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $title = $instance['title']; ?>

'' ) ); $instance['title'] = sanitize_text_field( $new_instance['title'] ); return $instance; } } PK,v\..class-wp-widget-media-image.phpnuW+A __( 'Displays an image.' ), 'mime_type' => 'image', ) ); $this->l10n = array_merge( $this->l10n, array( 'no_media_selected' => __( 'No image selected' ), 'add_media' => _x( 'Add Image', 'label for button in the image widget' ), 'replace_media' => _x( 'Replace Image', 'label for button in the image widget; should preferably not be longer than ~13 characters long' ), 'edit_media' => _x( 'Edit Image', 'label for button in the image widget; should preferably not be longer than ~13 characters long' ), 'missing_attachment' => sprintf( /* translators: %s: URL to media library. */ __( 'We can’t find that image. Check your media library and make sure it wasn’t deleted.' ), esc_url( admin_url( 'upload.php' ) ) ), /* translators: %d: Widget count. */ 'media_library_state_multi' => _n_noop( 'Image Widget (%d)', 'Image Widget (%d)' ), 'media_library_state_single' => __( 'Image Widget' ), ) ); } /** * Get schema for properties of a widget instance (item). * * @since 4.8.0 * * @see WP_REST_Controller::get_item_schema() * @see WP_REST_Controller::get_additional_fields() * @link https://core.trac.wordpress.org/ticket/35574 * * @return array Schema for properties. */ public function get_instance_schema() { return array_merge( array( 'size' => array( 'type' => 'string', 'enum' => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ), 'default' => 'medium', 'description' => __( 'Size' ), ), 'width' => array( // Via 'customWidth', only when size=custom; otherwise via 'width'. 'type' => 'integer', 'minimum' => 0, 'default' => 0, 'description' => __( 'Width' ), ), 'height' => array( // Via 'customHeight', only when size=custom; otherwise via 'height'. 'type' => 'integer', 'minimum' => 0, 'default' => 0, 'description' => __( 'Height' ), ), 'caption' => array( 'type' => 'string', 'default' => '', 'sanitize_callback' => 'wp_kses_post', 'description' => __( 'Caption' ), 'should_preview_update' => false, ), 'alt' => array( 'type' => 'string', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'description' => __( 'Alternative Text' ), ), 'link_type' => array( 'type' => 'string', 'enum' => array( 'none', 'file', 'post', 'custom' ), 'default' => 'custom', 'media_prop' => 'link', 'description' => __( 'Link To' ), 'should_preview_update' => true, ), 'link_url' => array( 'type' => 'string', 'default' => '', 'format' => 'uri', 'media_prop' => 'linkUrl', 'description' => __( 'URL' ), 'should_preview_update' => true, ), 'image_classes' => array( 'type' => 'string', 'default' => '', 'sanitize_callback' => array( $this, 'sanitize_token_list' ), 'media_prop' => 'extraClasses', 'description' => __( 'Image CSS Class' ), 'should_preview_update' => false, ), 'link_classes' => array( 'type' => 'string', 'default' => '', 'sanitize_callback' => array( $this, 'sanitize_token_list' ), 'media_prop' => 'linkClassName', 'should_preview_update' => false, 'description' => __( 'Link CSS Class' ), ), 'link_rel' => array( 'type' => 'string', 'default' => '', 'sanitize_callback' => array( $this, 'sanitize_token_list' ), 'media_prop' => 'linkRel', 'description' => __( 'Link Rel' ), 'should_preview_update' => false, ), 'link_target_blank' => array( 'type' => 'boolean', 'default' => false, 'media_prop' => 'linkTargetBlank', 'description' => __( 'Open link in a new tab' ), 'should_preview_update' => false, ), 'image_title' => array( 'type' => 'string', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'media_prop' => 'title', 'description' => __( 'Image Title Attribute' ), 'should_preview_update' => false, ), /* * There are two additional properties exposed by the PostImage modal * that don't seem to be relevant, as they may only be derived read-only * values: * - originalUrl * - aspectRatio * - height (redundant when size is not custom) * - width (redundant when size is not custom) */ ), parent::get_instance_schema() ); } /** * Render the media on the frontend. * * @since 4.8.0 * * @param array $instance Widget instance props. */ public function render_media( $instance ) { $instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance ); $instance = wp_parse_args( $instance, array( 'size' => 'thumbnail', ) ); $attachment = null; if ( $this->is_attachment_with_mime_type( $instance['attachment_id'], $this->widget_options['mime_type'] ) ) { $attachment = get_post( $instance['attachment_id'] ); } if ( $attachment ) { $caption = ''; if ( ! isset( $instance['caption'] ) ) { $caption = $attachment->post_excerpt; } elseif ( trim( $instance['caption'] ) ) { $caption = $instance['caption']; } $image_attributes = array( 'class' => sprintf( 'image wp-image-%d %s', $attachment->ID, $instance['image_classes'] ), 'style' => 'max-width: 100%; height: auto;', ); if ( ! empty( $instance['image_title'] ) ) { $image_attributes['title'] = $instance['image_title']; } if ( $instance['alt'] ) { $image_attributes['alt'] = $instance['alt']; } $size = $instance['size']; if ( 'custom' === $size || ! in_array( $size, array_merge( get_intermediate_image_sizes(), array( 'full' ) ), true ) ) { $size = array( $instance['width'], $instance['height'] ); } $image_attributes['class'] .= sprintf( ' attachment-%1$s size-%1$s', is_array( $size ) ? join( 'x', $size ) : $size ); $image = wp_get_attachment_image( $attachment->ID, $size, false, $image_attributes ); $caption_size = _wp_get_image_size_from_meta( $instance['size'], wp_get_attachment_metadata( $attachment->ID ) ); $width = empty( $caption_size[0] ) ? 0 : $caption_size[0]; } else { if ( empty( $instance['url'] ) ) { return; } $instance['size'] = 'custom'; $caption = $instance['caption']; $width = $instance['width']; $classes = 'image ' . $instance['image_classes']; if ( 0 === $instance['width'] ) { $instance['width'] = ''; } if ( 0 === $instance['height'] ) { $instance['height'] = ''; } $image = sprintf( '%3$s', esc_attr( $classes ), esc_url( $instance['url'] ), esc_attr( $instance['alt'] ), esc_attr( $instance['width'] ), esc_attr( $instance['height'] ) ); } // End if(). $url = ''; if ( 'file' === $instance['link_type'] ) { $url = $attachment ? wp_get_attachment_url( $attachment->ID ) : $instance['url']; } elseif ( $attachment && 'post' === $instance['link_type'] ) { $url = get_attachment_link( $attachment->ID ); } elseif ( 'custom' === $instance['link_type'] && ! empty( $instance['link_url'] ) ) { $url = $instance['link_url']; } if ( $url ) { $link = sprintf( ' $width, 'caption' => $caption, ), $image ); } echo $image; } /** * Loads the required media files for the media manager and scripts for media widgets. * * @since 4.8.0 */ public function enqueue_admin_scripts() { parent::enqueue_admin_scripts(); $handle = 'media-image-widget'; wp_enqueue_script( $handle ); $exported_schema = array(); foreach ( $this->get_instance_schema() as $field => $field_schema ) { $exported_schema[ $field ] = wp_array_slice_assoc( $field_schema, array( 'type', 'default', 'enum', 'minimum', 'format', 'media_prop', 'should_preview_update' ) ); } wp_add_inline_script( $handle, sprintf( 'wp.mediaWidgets.modelConstructors[ %s ].prototype.schema = %s;', wp_json_encode( $this->id_base ), wp_json_encode( $exported_schema ) ) ); wp_add_inline_script( $handle, sprintf( ' wp.mediaWidgets.controlConstructors[ %1$s ].prototype.mime_type = %2$s; wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n = _.extend( {}, wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n, %3$s ); ', wp_json_encode( $this->id_base ), wp_json_encode( $this->widget_options['mime_type'] ), wp_json_encode( $this->l10n ) ) ); } /** * Render form template scripts. * * @since 4.8.0 */ public function render_control_template_scripts() { parent::render_control_template_scripts(); ?> __( 'Displays an image gallery.' ), 'mime_type' => 'image', ) ); $this->l10n = array_merge( $this->l10n, array( 'no_media_selected' => __( 'No images selected' ), 'add_media' => _x( 'Add Images', 'label for button in the gallery widget; should not be longer than ~13 characters long' ), 'replace_media' => '', 'edit_media' => _x( 'Edit Gallery', 'label for button in the gallery widget; should not be longer than ~13 characters long' ), ) ); } /** * Get schema for properties of a widget instance (item). * * @since 4.9.0 * * @see WP_REST_Controller::get_item_schema() * @see WP_REST_Controller::get_additional_fields() * @link https://core.trac.wordpress.org/ticket/35574 * * @return array Schema for properties. */ public function get_instance_schema() { $schema = array( 'title' => array( 'type' => 'string', 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'description' => __( 'Title for the widget' ), 'should_preview_update' => false, ), 'ids' => array( 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), 'sanitize_callback' => 'wp_parse_id_list', ), 'columns' => array( 'type' => 'integer', 'default' => 3, 'minimum' => 1, 'maximum' => 9, ), 'size' => array( 'type' => 'string', 'enum' => array_merge( get_intermediate_image_sizes(), array( 'full', 'custom' ) ), 'default' => 'thumbnail', ), 'link_type' => array( 'type' => 'string', 'enum' => array( 'post', 'file', 'none' ), 'default' => 'post', 'media_prop' => 'link', 'should_preview_update' => false, ), 'orderby_random' => array( 'type' => 'boolean', 'default' => false, 'media_prop' => '_orderbyRandom', 'should_preview_update' => false, ), ); /** This filter is documented in wp-includes/widgets/class-wp-widget-media.php */ $schema = apply_filters( "widget_{$this->id_base}_instance_schema", $schema, $this ); return $schema; } /** * Render the media on the frontend. * * @since 4.9.0 * * @param array $instance Widget instance props. */ public function render_media( $instance ) { $instance = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance ); $shortcode_atts = array_merge( $instance, array( 'link' => $instance['link_type'], ) ); // @codeCoverageIgnoreStart if ( $instance['orderby_random'] ) { $shortcode_atts['orderby'] = 'rand'; } // @codeCoverageIgnoreEnd echo gallery_shortcode( $shortcode_atts ); } /** * Loads the required media files for the media manager and scripts for media widgets. * * @since 4.9.0 */ public function enqueue_admin_scripts() { parent::enqueue_admin_scripts(); $handle = 'media-gallery-widget'; wp_enqueue_script( $handle ); $exported_schema = array(); foreach ( $this->get_instance_schema() as $field => $field_schema ) { $exported_schema[ $field ] = wp_array_slice_assoc( $field_schema, array( 'type', 'default', 'enum', 'minimum', 'format', 'media_prop', 'should_preview_update', 'items' ) ); } wp_add_inline_script( $handle, sprintf( 'wp.mediaWidgets.modelConstructors[ %s ].prototype.schema = %s;', wp_json_encode( $this->id_base ), wp_json_encode( $exported_schema ) ) ); wp_add_inline_script( $handle, sprintf( ' wp.mediaWidgets.controlConstructors[ %1$s ].prototype.mime_type = %2$s; _.extend( wp.mediaWidgets.controlConstructors[ %1$s ].prototype.l10n, %3$s ); ', wp_json_encode( $this->id_base ), wp_json_encode( $this->widget_options['mime_type'] ), wp_json_encode( $this->l10n ) ) ); } /** * Render form template scripts. * * @since 4.9.0 */ public function render_control_template_scripts() { parent::render_control_template_scripts(); ?> 'widget_calendar', 'description' => __( 'A calendar of your site’s posts.' ), 'customize_selective_refresh' => true, ); parent::__construct( 'calendar', __( 'Calendar' ), $widget_ops ); } /** * Outputs the content for the current Calendar widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance The settings for the particular instance of the widget. */ public function widget( $args, $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } if ( 0 === self::$instance ) { echo '
'; } else { echo '
'; } get_calendar(); echo '
'; echo $args['after_widget']; self::$instance++; } /** * Handles updating settings for the current Calendar widget instance. * * @since 2.8.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Updated settings to save. */ public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = sanitize_text_field( $new_instance['title'] ); return $instance; } /** * Outputs the settings form for the Calendar widget. * * @since 2.8.0 * * @param array $instance Current settings. */ public function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); ?>

__( 'Your blogroll' ), 'customize_selective_refresh' => true, ); parent::__construct( 'links', __( 'Links' ), $widget_ops ); } /** * Outputs the content for the current Links widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Links widget instance. */ public function widget( $args, $instance ) { $show_description = isset( $instance['description'] ) ? $instance['description'] : false; $show_name = isset( $instance['name'] ) ? $instance['name'] : false; $show_rating = isset( $instance['rating'] ) ? $instance['rating'] : false; $show_images = isset( $instance['images'] ) ? $instance['images'] : true; $category = isset( $instance['category'] ) ? $instance['category'] : false; $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name'; $order = 'rating' === $orderby ? 'DESC' : 'ASC'; $limit = isset( $instance['limit'] ) ? $instance['limit'] : -1; $before_widget = preg_replace( '/id="[^"]*"/', 'id="%id"', $args['before_widget'] ); $widget_links_args = array( 'title_before' => $args['before_title'], 'title_after' => $args['after_title'], 'category_before' => $before_widget, 'category_after' => $args['after_widget'], 'show_images' => $show_images, 'show_description' => $show_description, 'show_name' => $show_name, 'show_rating' => $show_rating, 'category' => $category, 'class' => 'linkcat widget', 'orderby' => $orderby, 'order' => $order, 'limit' => $limit, ); /** * Filters the arguments for the Links widget. * * @since 2.6.0 * @since 4.4.0 Added the `$instance` parameter. * * @see wp_list_bookmarks() * * @param array $widget_links_args An array of arguments to retrieve the links list. * @param array $instance The settings for the particular instance of the widget. */ wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) ); } /** * Handles updating settings for the current Links widget instance. * * @since 2.8.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Updated settings to save. */ public function update( $new_instance, $old_instance ) { $new_instance = (array) $new_instance; $instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0, ); foreach ( $instance as $field => $val ) { if ( isset( $new_instance[ $field ] ) ) { $instance[ $field ] = 1; } } $instance['orderby'] = 'name'; if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ) ) ) { $instance['orderby'] = $new_instance['orderby']; } $instance['category'] = intval( $new_instance['category'] ); $instance['limit'] = ! empty( $new_instance['limit'] ) ? intval( $new_instance['limit'] ) : -1; return $instance; } /** * Outputs the settings form for the Links widget. * * @since 2.8.0 * * @param array $instance Current settings. */ public function form( $instance ) { // Defaults. $instance = wp_parse_args( (array) $instance, array( 'images' => true, 'name' => true, 'description' => false, 'rating' => false, 'category' => false, 'orderby' => 'name', 'limit' => -1, ) ); $link_cats = get_terms( array( 'taxonomy' => 'link_category' ) ); $limit = intval( $instance['limit'] ); if ( ! $limit ) { $limit = -1; } ?>

id="get_field_id( 'images' ); ?>" name="get_field_name( 'images' ); ?>" />
id="get_field_id( 'name' ); ?>" name="get_field_name( 'name' ); ?>" />
id="get_field_id( 'description' ); ?>" name="get_field_name( 'description' ); ?>" />
id="get_field_id( 'rating' ); ?>" name="get_field_name( 'rating' ); ?>" />

'widget_meta', 'description' => __( 'Login, RSS, & WordPress.org links.' ), 'customize_selective_refresh' => true, ); parent::__construct( 'meta', __( 'Meta' ), $widget_ops ); } /** * Outputs the content for the current Meta widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Meta widget instance. */ public function widget( $args, $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Meta' ); /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } ?>
'' ) ); ?>

'widget_recent_comments', 'description' => __( 'Your site’s most recent comments.' ), 'customize_selective_refresh' => true, ); parent::__construct( 'recent-comments', __( 'Recent Comments' ), $widget_ops ); $this->alt_option_name = 'widget_recent_comments'; if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { add_action( 'wp_head', array( $this, 'recent_comments_style' ) ); } } /** * Outputs the default styles for the Recent Comments widget. * * @since 2.8.0 */ public function recent_comments_style() { /** * Filters the Recent Comments default widget styles. * * @since 3.1.0 * * @param bool $active Whether the widget is active. Default true. * @param string $id_base The widget ID. */ if ( ! current_theme_supports( 'widgets' ) // Temp hack #14876. || ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) { return; } $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; printf( '.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}', $type_attr ); } /** * Outputs the content for the current Recent Comments widget instance. * * @since 2.8.0 * @since 5.4.0 Creates a unique HTML ID for the `
')).append(l("

",{text:o})),n.errorNoticeContainer.empty(),n.errorNoticeContainer.append(t),n.errorNoticeContainer.slideDown("fast"),wp.a11y.speak(o)):n.errorNoticeContainer.slideUp("fast")},initializeEditor:function(){var e,t=this;c.codeEditorSettings.disabled||(e=_.extend({},c.codeEditorSettings,{onTabPrevious:function(){t.fields.title.focus()},onTabNext:function(){t.syncContainer.add(t.syncContainer.parent().find(".widget-position, .widget-control-actions")).find(":tabbable").first().focus()},onChangeLintingErrors:function(e){t.currentErrorAnnotations=e},onUpdateErrorNotice:function(e){t.saveButton.toggleClass("validation-blocked disabled",0 .widget-inside > .form, > .widget-inside > form")).find("> .id_base").val(),-1!==c.idBases.indexOf(n)&&(d=i.find(".widget-id").val(),c.widgetControls[d]||(a=l("
"),(s=t.find(".widget-content:first")).before(a),o=new c.CustomHtmlWidgetControl({el:a,syncContainer:s}),c.widgetControls[d]=o,(r=function(){(wp.customize?t.parent().hasClass("expanded"):t.hasClass("open"))?o.initializeEditor():setTimeout(r,50)})()))},c.setupAccessibleMode=function(){var e,t,i,n;0!==(e=l(".editwidget > form")).length&&(t=e.find("> .widget-control-actions > .id_base").val(),-1!==c.idBases.indexOf(t)&&(i=l("
"),(n=e.find("> .widget-inside")).before(i),new c.CustomHtmlWidgetControl({el:i,syncContainer:n}).initializeEditor()))},c.handleWidgetUpdated=function(e,t){var i,n,o,d;d=(i=t.find("> .widget-inside > .form, > .widget-inside > form")).find("> .id_base").val(),-1!==c.idBases.indexOf(d)&&(n=i.find("> .widget-id").val(),(o=c.widgetControls[n])&&o.updateFields())},c.init=function(e){var t=l(document);_.extend(c.codeEditorSettings,e),t.on("widget-added",c.handleWidgetAdded),t.on("widget-synced widget-updated",c.handleWidgetUpdated),l(function(){"widgets"===window.pagenow&&(l(".widgets-holder-wrap:not(#available-widgets)").find("div.widget").one("click.toggle-widget-expanded",function(){var e=l(this);c.handleWidgetAdded(new jQuery.Event("widget-added"),e)}),l(window).on("load",function(){c.setupAccessibleMode()}))})},c}(jQuery);PKz8\'H==custom-html-widgets.jsnuW+A/** * @output wp-admin/js/widgets/custom-html-widgets.js */ /* global wp */ /* eslint consistent-this: [ "error", "control" ] */ /* eslint no-magic-numbers: ["error", { "ignore": [0,1,-1] }] */ /** * @namespace wp.customHtmlWidget * @memberOf wp */ wp.customHtmlWidgets = ( function( $ ) { 'use strict'; var component = { idBases: [ 'custom_html' ], codeEditorSettings: {}, l10n: { errorNotice: { singular: '', plural: '' } } }; component.CustomHtmlWidgetControl = Backbone.View.extend(/** @lends wp.customHtmlWidgets.CustomHtmlWidgetControl.prototype */{ /** * View events. * * @type {Object} */ events: {}, /** * Text widget control. * * @constructs wp.customHtmlWidgets.CustomHtmlWidgetControl * @augments Backbone.View * @abstract * * @param {Object} options - Options. * @param {jQuery} options.el - Control field container element. * @param {jQuery} options.syncContainer - Container element where fields are synced for the server. * * @return {void} */ initialize: function initialize( options ) { var control = this; if ( ! options.el ) { throw new Error( 'Missing options.el' ); } if ( ! options.syncContainer ) { throw new Error( 'Missing options.syncContainer' ); } Backbone.View.prototype.initialize.call( control, options ); control.syncContainer = options.syncContainer; control.widgetIdBase = control.syncContainer.parent().find( '.id_base' ).val(); control.widgetNumber = control.syncContainer.parent().find( '.widget_number' ).val(); control.customizeSettingId = 'widget_' + control.widgetIdBase + '[' + String( control.widgetNumber ) + ']'; control.$el.addClass( 'custom-html-widget-fields' ); control.$el.html( wp.template( 'widget-custom-html-control-fields' )( { codeEditorDisabled: component.codeEditorSettings.disabled } ) ); control.errorNoticeContainer = control.$el.find( '.code-editor-error-container' ); control.currentErrorAnnotations = []; control.saveButton = control.syncContainer.add( control.syncContainer.parent().find( '.widget-control-actions' ) ).find( '.widget-control-save, #savewidget' ); control.saveButton.addClass( 'custom-html-widget-save-button' ); // To facilitate style targeting. control.fields = { title: control.$el.find( '.title' ), content: control.$el.find( '.content' ) }; // Sync input fields to hidden sync fields which actually get sent to the server. _.each( control.fields, function( fieldInput, fieldName ) { fieldInput.on( 'input change', function updateSyncField() { var syncInput = control.syncContainer.find( '.sync-input.' + fieldName ); if ( syncInput.val() !== fieldInput.val() ) { syncInput.val( fieldInput.val() ); syncInput.trigger( 'change' ); } }); // Note that syncInput cannot be re-used because it will be destroyed with each widget-updated event. fieldInput.val( control.syncContainer.find( '.sync-input.' + fieldName ).val() ); }); }, /** * Update input fields from the sync fields. * * This function is called at the widget-updated and widget-synced events. * A field will only be updated if it is not currently focused, to avoid * overwriting content that the user is entering. * * @return {void} */ updateFields: function updateFields() { var control = this, syncInput; if ( ! control.fields.title.is( document.activeElement ) ) { syncInput = control.syncContainer.find( '.sync-input.title' ); control.fields.title.val( syncInput.val() ); } /* * Prevent updating content when the editor is focused or if there are current error annotations, * to prevent the editor's contents from getting sanitized as soon as a user removes focus from * the editor. This is particularly important for users who cannot unfiltered_html. */ control.contentUpdateBypassed = control.fields.content.is( document.activeElement ) || control.editor && control.editor.codemirror.state.focused || 0 !== control.currentErrorAnnotations.length; if ( ! control.contentUpdateBypassed ) { syncInput = control.syncContainer.find( '.sync-input.content' ); control.fields.content.val( syncInput.val() ); } }, /** * Show linting error notice. * * @param {Array} errorAnnotations - Error annotations. * @return {void} */ updateErrorNotice: function( errorAnnotations ) { var control = this, errorNotice, message = '', customizeSetting; if ( 1 === errorAnnotations.length ) { message = component.l10n.errorNotice.singular.replace( '%d', '1' ); } else if ( errorAnnotations.length > 1 ) { message = component.l10n.errorNotice.plural.replace( '%d', String( errorAnnotations.length ) ); } if ( control.fields.content[0].setCustomValidity ) { control.fields.content[0].setCustomValidity( message ); } if ( wp.customize && wp.customize.has( control.customizeSettingId ) ) { customizeSetting = wp.customize( control.customizeSettingId ); customizeSetting.notifications.remove( 'htmlhint_error' ); if ( 0 !== errorAnnotations.length ) { customizeSetting.notifications.add( 'htmlhint_error', new wp.customize.Notification( 'htmlhint_error', { message: message, type: 'error' } ) ); } } else if ( 0 !== errorAnnotations.length ) { errorNotice = $( '
' ); errorNotice.append( $( '

', { text: message } ) ); control.errorNoticeContainer.empty(); control.errorNoticeContainer.append( errorNotice ); control.errorNoticeContainer.slideDown( 'fast' ); wp.a11y.speak( message ); } else { control.errorNoticeContainer.slideUp( 'fast' ); } }, /** * Initialize editor. * * @return {void} */ initializeEditor: function initializeEditor() { var control = this, settings; if ( component.codeEditorSettings.disabled ) { return; } settings = _.extend( {}, component.codeEditorSettings, { /** * Handle tabbing to the field before the editor. * * @ignore * * @return {void} */ onTabPrevious: function onTabPrevious() { control.fields.title.focus(); }, /** * Handle tabbing to the field after the editor. * * @ignore * * @return {void} */ onTabNext: function onTabNext() { var tabbables = control.syncContainer.add( control.syncContainer.parent().find( '.widget-position, .widget-control-actions' ) ).find( ':tabbable' ); tabbables.first().focus(); }, /** * Disable save button and store linting errors for use in updateFields. * * @ignore * * @param {Array} errorAnnotations - Error notifications. * @return {void} */ onChangeLintingErrors: function onChangeLintingErrors( errorAnnotations ) { control.currentErrorAnnotations = errorAnnotations; }, /** * Update error notice. * * @ignore * * @param {Array} errorAnnotations - Error annotations. * @return {void} */ onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) { control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 ); control.updateErrorNotice( errorAnnotations ); } }); control.editor = wp.codeEditor.initialize( control.fields.content, settings ); // Improve the editor accessibility. $( control.editor.codemirror.display.lineDiv ) .attr({ role: 'textbox', 'aria-multiline': 'true', 'aria-labelledby': control.fields.content[0].id + '-label', 'aria-describedby': 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4' }); // Focus the editor when clicking on its label. $( '#' + control.fields.content[0].id + '-label' ).on( 'click', function() { control.editor.codemirror.focus(); }); control.fields.content.on( 'change', function() { if ( this.value !== control.editor.codemirror.getValue() ) { control.editor.codemirror.setValue( this.value ); } }); control.editor.codemirror.on( 'change', function() { var value = control.editor.codemirror.getValue(); if ( value !== control.fields.content.val() ) { control.fields.content.val( value ).trigger( 'change' ); } }); // Make sure the editor gets updated if the content was updated on the server (sanitization) but not updated in the editor since it was focused. control.editor.codemirror.on( 'blur', function() { if ( control.contentUpdateBypassed ) { control.syncContainer.find( '.sync-input.content' ).trigger( 'change' ); } }); // Prevent hitting Esc from collapsing the widget control. if ( wp.customize ) { control.editor.codemirror.on( 'keydown', function onKeydown( codemirror, event ) { var escKeyCode = 27; if ( escKeyCode === event.keyCode ) { event.stopPropagation(); } }); } } }); /** * Mapping of widget ID to instances of CustomHtmlWidgetControl subclasses. * * @alias wp.customHtmlWidgets.widgetControls * * @type {Object.} */ component.widgetControls = {}; /** * Handle widget being added or initialized for the first time at the widget-added event. * * @alias wp.customHtmlWidgets.handleWidgetAdded * * @param {jQuery.Event} event - Event. * @param {jQuery} widgetContainer - Widget container element. * * @return {void} */ component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) { var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone, fieldContainer, syncContainer; widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen. idBase = widgetForm.find( '> .id_base' ).val(); if ( -1 === component.idBases.indexOf( idBase ) ) { return; } // Prevent initializing already-added widgets. widgetId = widgetForm.find( '.widget-id' ).val(); if ( component.widgetControls[ widgetId ] ) { return; } /* * Create a container element for the widget control fields. * This is inserted into the DOM immediately before the the .widget-content * element because the contents of this element are essentially "managed" * by PHP, where each widget update cause the entire element to be emptied * and replaced with the rendered output of WP_Widget::form() which is * sent back in Ajax request made to save/update the widget instance. * To prevent a "flash of replaced DOM elements and re-initialized JS * components", the JS template is rendered outside of the normal form * container. */ fieldContainer = $( '
' ); syncContainer = widgetContainer.find( '.widget-content:first' ); syncContainer.before( fieldContainer ); widgetControl = new component.CustomHtmlWidgetControl({ el: fieldContainer, syncContainer: syncContainer }); component.widgetControls[ widgetId ] = widgetControl; /* * Render the widget once the widget parent's container finishes animating, * as the widget-added event fires with a slideDown of the container. * This ensures that the textarea is visible and the editor can be initialized. */ renderWhenAnimationDone = function() { if ( ! ( wp.customize ? widgetContainer.parent().hasClass( 'expanded' ) : widgetContainer.hasClass( 'open' ) ) ) { // Core merge: The wp.customize condition can be eliminated with this change being in core: https://github.com/xwp/wordpress-develop/pull/247/commits/5322387d setTimeout( renderWhenAnimationDone, animatedCheckDelay ); } else { widgetControl.initializeEditor(); } }; renderWhenAnimationDone(); }; /** * Setup widget in accessibility mode. * * @alias wp.customHtmlWidgets.setupAccessibleMode * * @return {void} */ component.setupAccessibleMode = function setupAccessibleMode() { var widgetForm, idBase, widgetControl, fieldContainer, syncContainer; widgetForm = $( '.editwidget > form' ); if ( 0 === widgetForm.length ) { return; } idBase = widgetForm.find( '> .widget-control-actions > .id_base' ).val(); if ( -1 === component.idBases.indexOf( idBase ) ) { return; } fieldContainer = $( '
' ); syncContainer = widgetForm.find( '> .widget-inside' ); syncContainer.before( fieldContainer ); widgetControl = new component.CustomHtmlWidgetControl({ el: fieldContainer, syncContainer: syncContainer }); widgetControl.initializeEditor(); }; /** * Sync widget instance data sanitized from server back onto widget model. * * This gets called via the 'widget-updated' event when saving a widget from * the widgets admin screen and also via the 'widget-synced' event when making * a change to a widget in the customizer. * * @alias wp.customHtmlWidgets.handleWidgetUpdated * * @param {jQuery.Event} event - Event. * @param {jQuery} widgetContainer - Widget container element. * @return {void} */ component.handleWidgetUpdated = function handleWidgetUpdated( event, widgetContainer ) { var widgetForm, widgetId, widgetControl, idBase; widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); idBase = widgetForm.find( '> .id_base' ).val(); if ( -1 === component.idBases.indexOf( idBase ) ) { return; } widgetId = widgetForm.find( '> .widget-id' ).val(); widgetControl = component.widgetControls[ widgetId ]; if ( ! widgetControl ) { return; } widgetControl.updateFields(); }; /** * Initialize functionality. * * This function exists to prevent the JS file from having to boot itself. * When WordPress enqueues this script, it should have an inline script * attached which calls wp.textWidgets.init(). * * @alias wp.customHtmlWidgets.init * * @param {object} settings - Options for code editor, exported from PHP. * * @return {void} */ component.init = function init( settings ) { var $document = $( document ); _.extend( component.codeEditorSettings, settings ); $document.on( 'widget-added', component.handleWidgetAdded ); $document.on( 'widget-synced widget-updated', component.handleWidgetUpdated ); /* * Manually trigger widget-added events for media widgets on the admin * screen once they are expanded. The widget-added event is not triggered * for each pre-existing widget on the widgets admin screen like it is * on the customizer. Likewise, the customizer only triggers widget-added * when the widget is expanded to just-in-time construct the widget form * when it is actually going to be displayed. So the following implements * the same for the widgets admin screen, to invoke the widget-added * handler when a pre-existing media widget is expanded. */ $( function initializeExistingWidgetContainers() { var widgetContainers; if ( 'widgets' !== window.pagenow ) { return; } widgetContainers = $( '.widgets-holder-wrap:not(#available-widgets)' ).find( 'div.widget' ); widgetContainers.one( 'click.toggle-widget-expanded', function toggleWidgetExpanded() { var widgetContainer = $( this ); component.handleWidgetAdded( new jQuery.Event( 'widget-added' ), widgetContainer ); }); // Accessibility mode. $( window ).on( 'load', function() { component.setupAccessibleMode(); }); }); }; return component; })( jQuery ); PKh=\Z  &class-wc-widget-top-rated-products.phpnuW+Awidget_cssclass = 'woocommerce widget_top_rated_products'; $this->widget_description = __( 'Display a list of your top rated products on your site.', 'woocommerce' ); $this->widget_id = 'woocommerce_top_rated_products'; $this->widget_name = __( 'WooCommerce Top Rated Products', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Top Rated Products', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ), 'number' => array( 'type' => 'number', 'step' => 1, 'min' => 1, 'max' => '', 'std' => 5, 'label' => __( 'Number of products to show', 'woocommerce' ) ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { if ( $this->get_cached_widget( $args ) ) { return; } ob_start(); $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std']; add_filter( 'posts_clauses', array( WC()->query, 'order_by_rating_post_clauses' ) ); $query_args = array( 'posts_per_page' => $number, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product' ); $query_args['meta_query'] = WC()->query->get_meta_query(); $r = new WP_Query( $query_args ); if ( $r->have_posts() ) { $this->widget_start( $args, $instance ); echo ''; $this->widget_end( $args ); } remove_filter( 'posts_clauses', array( WC()->query, 'order_by_rating_post_clauses' ) ); wp_reset_postdata(); $content = ob_get_clean(); echo $content; $this->cache_widget( $args, $content ); } } PKh=\DD class-wc-widget-price-filter.phpnuW+Awidget_cssclass = 'woocommerce widget_price_filter'; $this->widget_description = __( 'Shows a price filter slider in a widget which lets you narrow down the list of shown products when viewing product categories.', 'woocommerce' ); $this->widget_id = 'woocommerce_price_filter'; $this->widget_name = __( 'WooCommerce Price Filter', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Filter by price', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ) ); $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_register_script( 'wc-jquery-ui-touchpunch', WC()->plugin_url() . '/assets/js/jquery-ui-touch-punch/jquery-ui-touch-punch' . $suffix . '.js', array( 'jquery-ui-slider' ), WC_VERSION, true ); wp_register_script( 'wc-price-slider', WC()->plugin_url() . '/assets/js/frontend/price-slider' . $suffix . '.js', array( 'jquery-ui-slider', 'wc-jquery-ui-touchpunch' ), WC_VERSION, true ); wp_localize_script( 'wc-price-slider', 'woocommerce_price_slider_params', array( 'currency_symbol' => get_woocommerce_currency_symbol(), 'currency_pos' => get_option( 'woocommerce_currency_pos' ), 'min_price' => isset( $_GET['min_price'] ) ? esc_attr( $_GET['min_price'] ) : '', 'max_price' => isset( $_GET['max_price'] ) ? esc_attr( $_GET['max_price'] ) : '' ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { global $wp, $wp_the_query; if ( ! is_post_type_archive( 'product' ) && ! is_tax( get_object_taxonomies( 'product' ) ) ) { return; } if ( ! $wp_the_query->post_count ) { return; } $min_price = isset( $_GET['min_price'] ) ? esc_attr( $_GET['min_price'] ) : ''; $max_price = isset( $_GET['max_price'] ) ? esc_attr( $_GET['max_price'] ) : ''; wp_enqueue_script( 'wc-price-slider' ); // Remember current filters/search $fields = ''; if ( get_search_query() ) { $fields .= ''; } if ( ! empty( $_GET['post_type'] ) ) { $fields .= ''; } if ( ! empty ( $_GET['product_cat'] ) ) { $fields .= ''; } if ( ! empty( $_GET['product_tag'] ) ) { $fields .= ''; } if ( ! empty( $_GET['orderby'] ) ) { $fields .= ''; } if ( ! empty( $_GET['min_rating'] ) ) { $fields .= ''; } if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { foreach ( $_chosen_attributes as $attribute => $data ) { $taxonomy_filter = 'filter_' . str_replace( 'pa_', '', $attribute ); $fields .= ''; if ( 'or' == $data['query_type'] ) { $fields .= ''; } } } // Find min and max price in current result set $prices = $this->get_filtered_price(); $min = floor( $prices->min_price ); $max = ceil( $prices->max_price ); if ( $min === $max ) { return; } $this->widget_start( $args, $instance ); if ( '' === get_option( 'permalink_structure' ) ) { $form_action = remove_query_arg( array( 'page', 'paged' ), add_query_arg( $wp->query_string, '', home_url( $wp->request ) ) ); } else { $form_action = preg_replace( '%\/page/[0-9]+%', '', home_url( trailingslashit( $wp->request ) ) ); } /** * Adjust max if the store taxes are not displayed how they are stored. * Min is left alone because the product may not be taxable. * Kicks in when prices excluding tax are displayed including tax. */ if ( wc_tax_enabled() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) && ! wc_prices_include_tax() ) { $tax_classes = array_merge( array( '' ), WC_Tax::get_tax_classes() ); $class_max = $max; foreach ( $tax_classes as $tax_class ) { if ( $tax_rates = WC_Tax::get_rates( $tax_class ) ) { $class_max = $max + WC_Tax::get_tax_total( WC_Tax::calc_exclusive_tax( $max, $tax_rates ) ); } } $max = $class_max; } echo '
' . $fields . '
'; $this->widget_end( $args ); } /** * Get filtered min price for current products. * @return int */ protected function get_filtered_price() { global $wpdb, $wp_the_query; $args = $wp_the_query->query_vars; $tax_query = isset( $args['tax_query'] ) ? $args['tax_query'] : array(); $meta_query = isset( $args['meta_query'] ) ? $args['meta_query'] : array(); if ( ! empty( $args['taxonomy'] ) && ! empty( $args['term'] ) ) { $tax_query[] = array( 'taxonomy' => $args['taxonomy'], 'terms' => array( $args['term'] ), 'field' => 'slug', ); } foreach ( $meta_query as $key => $query ) { if ( ! empty( $query['price_filter'] ) || ! empty( $query['rating_filter'] ) ) { unset( $meta_query[ $key ] ); } } $meta_query = new WP_Meta_Query( $meta_query ); $tax_query = new WP_Tax_Query( $tax_query ); $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' ); $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' ); $sql = "SELECT min( FLOOR( price_meta.meta_value ) ) as min_price, max( CEILING( price_meta.meta_value ) ) as max_price FROM {$wpdb->posts} "; $sql .= " LEFT JOIN {$wpdb->postmeta} as price_meta ON {$wpdb->posts}.ID = price_meta.post_id " . $tax_query_sql['join'] . $meta_query_sql['join']; $sql .= " WHERE {$wpdb->posts}.post_type IN ('" . implode( "','", array_map( 'esc_sql', apply_filters( 'woocommerce_price_filter_post_type', array( 'product' ) ) ) ) . "') AND {$wpdb->posts}.post_status = 'publish' AND price_meta.meta_key IN ('" . implode( "','", array_map( 'esc_sql', apply_filters( 'woocommerce_price_filter_meta_keys', array( '_price' ) ) ) ) . "') AND price_meta.meta_value > '' "; $sql .= $tax_query_sql['where'] . $meta_query_sql['where']; return $wpdb->get_row( $sql ); } } PKh=\Im m "class-wc-widget-recent-reviews.phpnuW+Awidget_cssclass = 'woocommerce widget_recent_reviews'; $this->widget_description = __( 'Display a list of your most recent reviews on your site.', 'woocommerce' ); $this->widget_id = 'woocommerce_recent_reviews'; $this->widget_name = __( 'WooCommerce Recent Reviews', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Recent Reviews', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ), 'number' => array( 'type' => 'number', 'step' => 1, 'min' => 1, 'max' => '', 'std' => 10, 'label' => __( 'Number of reviews to show', 'woocommerce' ) ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { global $comments, $comment; if ( $this->get_cached_widget( $args ) ) { return; } ob_start(); $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std']; $comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product' ) ); if ( $comments ) { $this->widget_start( $args, $instance ); echo ''; $this->widget_end( $args ); } $content = ob_get_clean(); echo $content; $this->cache_widget( $args, $content ); } } PKh=\!\class-wc-widget-cart.phpnuW+Awidget_cssclass = 'woocommerce widget_shopping_cart'; $this->widget_description = __( "Display the user's Cart in the sidebar.", 'woocommerce' ); $this->widget_id = 'woocommerce_widget_cart'; $this->widget_name = __( 'WooCommerce Cart', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Cart', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ), 'hide_if_empty' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Hide if cart is empty', 'woocommerce' ) ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { if ( apply_filters( 'woocommerce_widget_cart_is_hidden', is_cart() || is_checkout() ) ) { return; } $hide_if_empty = empty( $instance['hide_if_empty'] ) ? 0 : 1; $this->widget_start( $args, $instance ); if ( $hide_if_empty ) { echo '
'; } // Insert cart widget placeholder - code in woocommerce.js will update this on page load echo '
'; if ( $hide_if_empty ) { echo '
'; } $this->widget_end( $args ); } } PKh=\"f_ _ #class-wc-widget-recently-viewed.phpnuW+Awidget_cssclass = 'woocommerce widget_recently_viewed_products'; $this->widget_description = __( 'Display a list of recently viewed products.', 'woocommerce' ); $this->widget_id = 'woocommerce_recently_viewed_products'; $this->widget_name = __( 'WooCommerce Recently Viewed', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Recently Viewed Products', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ), 'number' => array( 'type' => 'number', 'step' => 1, 'min' => 1, 'max' => '', 'std' => 10, 'label' => __( 'Number of products to show', 'woocommerce' ) ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { $viewed_products = ! empty( $_COOKIE['woocommerce_recently_viewed'] ) ? (array) explode( '|', $_COOKIE['woocommerce_recently_viewed'] ) : array(); $viewed_products = array_filter( array_map( 'absint', $viewed_products ) ); if ( empty( $viewed_products ) ) { return; } ob_start(); $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std']; $query_args = array( 'posts_per_page' => $number, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'post__in' => $viewed_products, 'orderby' => 'rand' ); $query_args['meta_query'] = array(); $query_args['meta_query'][] = WC()->query->stock_status_meta_query(); $query_args['meta_query'] = array_filter( $query_args['meta_query'] ); $r = new WP_Query( $query_args ); if ( $r->have_posts() ) { $this->widget_start( $args, $instance ); echo ''; $this->widget_end( $args ); } wp_reset_postdata(); $content = ob_get_clean(); echo $content; } } PKh=\!8'class-wc-widget-layered-nav-filters.phpnuW+Awidget_cssclass = 'woocommerce widget_layered_nav_filters'; $this->widget_description = __( 'Shows active layered nav filters so users can see and deactivate them.', 'woocommerce' ); $this->widget_id = 'woocommerce_layered_nav_filters'; $this->widget_name = __( 'WooCommerce Layered Nav Filters', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Active Filters', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ) ); parent::__construct(); } /** * Get current page URL for layered nav items. * * @return string */ protected function get_page_base_url() { if ( defined( 'SHOP_IS_ON_FRONT' ) ) { $link = home_url(); } elseif ( is_post_type_archive( 'product' ) || is_page( wc_get_page_id( 'shop' ) ) ) { $link = get_post_type_archive_link( 'product' ); } elseif ( is_product_category() ) { $link = get_term_link( get_query_var( 'product_cat' ), 'product_cat' ); } elseif ( is_product_tag() ) { $link = get_term_link( get_query_var( 'product_tag' ), 'product_tag' ); } else { $queried_object = get_queried_object(); $link = get_term_link( $queried_object->slug, $queried_object->taxonomy ); } // Min/Max if ( isset( $_GET['min_price'] ) ) { $link = add_query_arg( 'min_price', wc_clean( $_GET['min_price'] ), $link ); } if ( isset( $_GET['max_price'] ) ) { $link = add_query_arg( 'max_price', wc_clean( $_GET['max_price'] ), $link ); } // Orderby if ( isset( $_GET['orderby'] ) ) { $link = add_query_arg( 'orderby', wc_clean( $_GET['orderby'] ), $link ); } /** * Search Arg. * To support quote characters, first they are decoded from " entities, then URL encoded. */ if ( get_search_query() ) { $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link ); } // Post Type Arg if ( isset( $_GET['post_type'] ) ) { $link = add_query_arg( 'post_type', wc_clean( $_GET['post_type'] ), $link ); } // Min Rating Arg if ( isset( $_GET['min_rating'] ) ) { $link = add_query_arg( 'min_rating', wc_clean( $_GET['min_rating'] ), $link ); } // All current filters if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { foreach ( $_chosen_attributes as $name => $data ) { $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) ); if ( ! empty( $data['terms'] ) ) { $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link ); } if ( 'or' == $data['query_type'] ) { $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link ); } } } return $link; } /** * Output widget. * * @see WP_Widget * @param array $args * @param array $instance */ public function widget( $args, $instance ) { if ( ! is_post_type_archive( 'product' ) && ! is_tax( get_object_taxonomies( 'product' ) ) ) { return; } $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes(); $min_price = isset( $_GET['min_price'] ) ? wc_clean( $_GET['min_price'] ) : 0; $max_price = isset( $_GET['max_price'] ) ? wc_clean( $_GET['max_price'] ) : 0; $min_rating = isset( $_GET['min_rating'] ) ? absint( $_GET['min_rating'] ) : 0; $base_link = $this->get_page_base_url(); if ( 0 < count( $_chosen_attributes ) || 0 < $min_price || 0 < $max_price || 0 < $min_rating ) { $this->widget_start( $args, $instance ); echo ''; $this->widget_end( $args ); } } } PKh=\_[[!class-wc-widget-rating-filter.phpnuW+Awidget_cssclass = 'woocommerce widget_rating_filter'; $this->widget_description = __( 'Filter products by rating when viewing product archives and categories.', 'woocommerce' ); $this->widget_id = 'woocommerce_rating_filter'; $this->widget_name = __( 'WooCommerce Average Rating Filter', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Average Rating', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ) ); parent::__construct(); } /** * Get current page URL for layered nav items. * @return string */ protected function get_page_base_url() { if ( defined( 'SHOP_IS_ON_FRONT' ) ) { $link = home_url(); } elseif ( is_post_type_archive( 'product' ) || is_page( wc_get_page_id('shop') ) ) { $link = get_post_type_archive_link( 'product' ); } else { $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') ); } // Min/Max if ( isset( $_GET['min_price'] ) ) { $link = add_query_arg( 'min_price', wc_clean( $_GET['min_price'] ), $link ); } if ( isset( $_GET['max_price'] ) ) { $link = add_query_arg( 'max_price', wc_clean( $_GET['max_price'] ), $link ); } // Orderby if ( isset( $_GET['orderby'] ) ) { $link = add_query_arg( 'orderby', wc_clean( $_GET['orderby'] ), $link ); } /** * Search Arg. * To support quote characters, first they are decoded from " entities, then URL encoded. */ if ( get_search_query() ) { $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link ); } // Post Type Arg if ( isset( $_GET['post_type'] ) ) { $link = add_query_arg( 'post_type', wc_clean( $_GET['post_type'] ), $link ); } // All current filters if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { foreach ( $_chosen_attributes as $name => $data ) { $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) ); if ( ! empty( $data['terms'] ) ) { $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link ); } if ( 'or' == $data['query_type'] ) { $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link ); } } } return $link; } /** * Count products after other filters have occured by adjusting the main query. * @param int $rating * @return int */ protected function get_filtered_product_count( $rating ) { global $wpdb; $tax_query = WC_Query::get_main_tax_query(); $meta_query = WC_Query::get_main_meta_query(); // Unset current rating filter foreach ( $meta_query as $key => $query ) { if ( ! empty( $query['rating_filter'] ) ) { unset( $meta_query[ $key ] ); } } // Set new rating filter $meta_query[] = array( 'key' => '_wc_average_rating', 'value' => $rating, 'compare' => '>=', 'type' => 'DECIMAL', 'rating_filter' => true ); $meta_query = new WP_Meta_Query( $meta_query ); $tax_query = new WP_Tax_Query( $tax_query ); $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' ); $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' ); $sql = "SELECT COUNT( {$wpdb->posts}.ID ) FROM {$wpdb->posts} "; $sql .= $tax_query_sql['join'] . $meta_query_sql['join']; $sql .= " WHERE {$wpdb->posts}.post_type = 'product' AND {$wpdb->posts}.post_status = 'publish' "; $sql .= $tax_query_sql['where'] . $meta_query_sql['where']; return absint( $wpdb->get_var( $sql ) ); } /** * widget function. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { global $wp_the_query; if ( ! is_post_type_archive( 'product' ) && ! is_tax( get_object_taxonomies( 'product' ) ) ) { return; } if ( ! $wp_the_query->post_count ) { return; } ob_start(); $found = false; $min_rating = isset( $_GET['min_rating'] ) ? absint( $_GET['min_rating'] ) : ''; $this->widget_start( $args, $instance ); echo ''; $this->widget_end( $args ); if ( ! $found ) { ob_end_clean(); } else { echo ob_get_clean(); } } } PKh=\D  %class-wc-widget-product-tag-cloud.phpnuW+Awidget_cssclass = 'woocommerce widget_product_tag_cloud'; $this->widget_description = __( 'Your most used product tags in cloud format.', 'woocommerce' ); $this->widget_id = 'woocommerce_product_tag_cloud'; $this->widget_name = __( 'WooCommerce Product Tags', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Product Tags', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { $current_taxonomy = $this->_get_current_taxonomy( $instance ); if ( empty( $instance['title'] ) ) { $taxonomy = get_taxonomy( $current_taxonomy ); $instance['title'] = $taxonomy->labels->name; } $this->widget_start( $args, $instance ); echo '
'; wp_tag_cloud( apply_filters( 'woocommerce_product_tag_cloud_widget_args', array( 'taxonomy' => $current_taxonomy, 'topic_count_text_callback' => array( $this, '_topic_count_text' ), ) ) ); echo '
'; $this->widget_end( $args ); } /** * Return the taxonomy being displayed. * * @param object $instance * @return string */ public function _get_current_taxonomy( $instance ) { return 'product_tag'; } /** * Retuns topic count text. * * @since 2.6.0 * @param int $count * @return string */ public function _topic_count_text( $count ) { /* translators: %s for product quantity, e.g. 1 product and 2 products */ return sprintf( _n( '%s product', '%s products', $count, 'woocommerce' ), number_format_i18n( $count ) ); } } PKh=\]b]]class-wc-widget-products.phpnuW+Awidget_cssclass = 'woocommerce widget_products'; $this->widget_description = __( 'Display a list of your products on your site.', 'woocommerce' ); $this->widget_id = 'woocommerce_products'; $this->widget_name = __( 'WooCommerce Products', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Products', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ), 'number' => array( 'type' => 'number', 'step' => 1, 'min' => 1, 'max' => '', 'std' => 5, 'label' => __( 'Number of products to show', 'woocommerce' ) ), 'show' => array( 'type' => 'select', 'std' => '', 'label' => __( 'Show', 'woocommerce' ), 'options' => array( '' => __( 'All Products', 'woocommerce' ), 'featured' => __( 'Featured Products', 'woocommerce' ), 'onsale' => __( 'On-sale Products', 'woocommerce' ), ) ), 'orderby' => array( 'type' => 'select', 'std' => 'date', 'label' => __( 'Order by', 'woocommerce' ), 'options' => array( 'date' => __( 'Date', 'woocommerce' ), 'price' => __( 'Price', 'woocommerce' ), 'rand' => __( 'Random', 'woocommerce' ), 'sales' => __( 'Sales', 'woocommerce' ), ) ), 'order' => array( 'type' => 'select', 'std' => 'desc', 'label' => _x( 'Order', 'Sorting order', 'woocommerce' ), 'options' => array( 'asc' => __( 'ASC', 'woocommerce' ), 'desc' => __( 'DESC', 'woocommerce' ), ) ), 'hide_free' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Hide free products', 'woocommerce' ) ), 'show_hidden' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Show hidden products', 'woocommerce' ) ) ); parent::__construct(); } /** * Query the products and return them. * @param array $args * @param array $instance * @return WP_Query */ public function get_products( $args, $instance ) { $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std']; $show = ! empty( $instance['show'] ) ? sanitize_title( $instance['show'] ) : $this->settings['show']['std']; $orderby = ! empty( $instance['orderby'] ) ? sanitize_title( $instance['orderby'] ) : $this->settings['orderby']['std']; $order = ! empty( $instance['order'] ) ? sanitize_title( $instance['order'] ) : $this->settings['order']['std']; $query_args = array( 'posts_per_page' => $number, 'post_status' => 'publish', 'post_type' => 'product', 'no_found_rows' => 1, 'order' => $order, 'meta_query' => array() ); if ( empty( $instance['show_hidden'] ) ) { $query_args['meta_query'][] = WC()->query->visibility_meta_query(); $query_args['post_parent'] = 0; } if ( ! empty( $instance['hide_free'] ) ) { $query_args['meta_query'][] = array( 'key' => '_price', 'value' => 0, 'compare' => '>', 'type' => 'DECIMAL', ); } $query_args['meta_query'][] = WC()->query->stock_status_meta_query(); $query_args['meta_query'] = array_filter( $query_args['meta_query'] ); switch ( $show ) { case 'featured' : $query_args['meta_query'][] = array( 'key' => '_featured', 'value' => 'yes' ); break; case 'onsale' : $product_ids_on_sale = wc_get_product_ids_on_sale(); $product_ids_on_sale[] = 0; $query_args['post__in'] = $product_ids_on_sale; break; } switch ( $orderby ) { case 'price' : $query_args['meta_key'] = '_price'; $query_args['orderby'] = 'meta_value_num'; break; case 'rand' : $query_args['orderby'] = 'rand'; break; case 'sales' : $query_args['meta_key'] = 'total_sales'; $query_args['orderby'] = 'meta_value_num'; break; default : $query_args['orderby'] = 'date'; } return new WP_Query( apply_filters( 'woocommerce_products_widget_query_args', $query_args ) ); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { if ( $this->get_cached_widget( $args ) ) { return; } ob_start(); if ( ( $products = $this->get_products( $args, $instance ) ) && $products->have_posts() ) { $this->widget_start( $args, $instance ); echo apply_filters( 'woocommerce_before_widget_product_list', '' ); $this->widget_end( $args ); } wp_reset_postdata(); echo $this->cache_widget( $args, ob_get_clean() ); } } PKh=\:,,&class-wc-widget-product-categories.phpnuW+Awidget_cssclass = 'woocommerce widget_product_categories'; $this->widget_description = __( 'A list or dropdown of product categories.', 'woocommerce' ); $this->widget_id = 'woocommerce_product_categories'; $this->widget_name = __( 'WooCommerce Product Categories', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Product Categories', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ), 'orderby' => array( 'type' => 'select', 'std' => 'name', 'label' => __( 'Order by', 'woocommerce' ), 'options' => array( 'order' => __( 'Category Order', 'woocommerce' ), 'name' => __( 'Name', 'woocommerce' ) ) ), 'dropdown' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Show as dropdown', 'woocommerce' ) ), 'count' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Show product counts', 'woocommerce' ) ), 'hierarchical' => array( 'type' => 'checkbox', 'std' => 1, 'label' => __( 'Show hierarchy', 'woocommerce' ) ), 'show_children_only' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Only show children of the current category', 'woocommerce' ) ), 'hide_empty' => array( 'type' => 'checkbox', 'std' => 0, 'label' => __( 'Hide empty categories', 'woocommerce' ) ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { global $wp_query, $post; $count = isset( $instance['count'] ) ? $instance['count'] : $this->settings['count']['std']; $hierarchical = isset( $instance['hierarchical'] ) ? $instance['hierarchical'] : $this->settings['hierarchical']['std']; $show_children_only = isset( $instance['show_children_only'] ) ? $instance['show_children_only'] : $this->settings['show_children_only']['std']; $dropdown = isset( $instance['dropdown'] ) ? $instance['dropdown'] : $this->settings['dropdown']['std']; $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : $this->settings['orderby']['std']; $hide_empty = isset( $instance['hide_empty'] ) ? $instance['hide_empty'] : $this->settings['hide_empty']['std']; $dropdown_args = array( 'hide_empty' => $hide_empty ); $list_args = array( 'show_count' => $count, 'hierarchical' => $hierarchical, 'taxonomy' => 'product_cat', 'hide_empty' => $hide_empty ); // Menu Order $list_args['menu_order'] = false; if ( $orderby == 'order' ) { $list_args['menu_order'] = 'asc'; } else { $list_args['orderby'] = 'title'; } // Setup Current Category $this->current_cat = false; $this->cat_ancestors = array(); if ( is_tax( 'product_cat' ) ) { $this->current_cat = $wp_query->queried_object; $this->cat_ancestors = get_ancestors( $this->current_cat->term_id, 'product_cat' ); } elseif ( is_singular( 'product' ) ) { $product_category = wc_get_product_terms( $post->ID, 'product_cat', apply_filters( 'woocommerce_product_categories_widget_product_terms_args', array( 'orderby' => 'parent' ) ) ); if ( ! empty( $product_category ) ) { $this->current_cat = end( $product_category ); $this->cat_ancestors = get_ancestors( $this->current_cat->term_id, 'product_cat' ); } } // Show Siblings and Children Only if ( $show_children_only && $this->current_cat ) { // Top level is needed $top_level = get_terms( 'product_cat', array( 'fields' => 'ids', 'parent' => 0, 'hierarchical' => true, 'hide_empty' => false ) ); // Direct children are wanted $direct_children = get_terms( 'product_cat', array( 'fields' => 'ids', 'parent' => $this->current_cat->term_id, 'hierarchical' => true, 'hide_empty' => false ) ); // Gather siblings of ancestors $siblings = array(); if ( $this->cat_ancestors ) { foreach ( $this->cat_ancestors as $ancestor ) { $ancestor_siblings = get_terms( 'product_cat', array( 'fields' => 'ids', 'parent' => $ancestor, 'hierarchical' => false, 'hide_empty' => false ) ); $siblings = array_merge( $siblings, $ancestor_siblings ); } } if ( $hierarchical ) { $include = array_merge( $top_level, $this->cat_ancestors, $siblings, $direct_children, array( $this->current_cat->term_id ) ); } else { $include = array_merge( $direct_children ); } $dropdown_args['include'] = implode( ',', $include ); $list_args['include'] = implode( ',', $include ); if ( empty( $include ) ) { return; } } elseif ( $show_children_only ) { $dropdown_args['depth'] = 1; $dropdown_args['child_of'] = 0; $dropdown_args['hierarchical'] = 1; $list_args['depth'] = 1; $list_args['child_of'] = 0; $list_args['hierarchical'] = 1; } $this->widget_start( $args, $instance ); // Dropdown if ( $dropdown ) { $dropdown_defaults = array( 'show_count' => $count, 'hierarchical' => $hierarchical, 'show_uncategorized' => 0, 'orderby' => $orderby, 'selected' => $this->current_cat ? $this->current_cat->slug : '' ); $dropdown_args = wp_parse_args( $dropdown_args, $dropdown_defaults ); // Stuck with this until a fix for https://core.trac.wordpress.org/ticket/13258 wc_product_dropdown_categories( apply_filters( 'woocommerce_product_categories_widget_dropdown_args', $dropdown_args ) ); wc_enqueue_js( " jQuery( '.dropdown_product_cat' ).change( function() { if ( jQuery(this).val() != '' ) { var this_page = ''; var home_url = '" . esc_js( home_url( '/' ) ) . "'; if ( home_url.indexOf( '?' ) > 0 ) { this_page = home_url + '&product_cat=' + jQuery(this).val(); } else { this_page = home_url + '?product_cat=' + jQuery(this).val(); } location.href = this_page; } }); " ); // List } else { include_once( WC()->plugin_path() . '/includes/walkers/class-product-cat-list-walker.php' ); $list_args['walker'] = new WC_Product_Cat_List_Walker; $list_args['title_li'] = ''; $list_args['pad_counts'] = 1; $list_args['show_option_none'] = __('No product categories exist.', 'woocommerce' ); $list_args['current_category'] = ( $this->current_cat ) ? $this->current_cat->term_id : ''; $list_args['current_category_ancestors'] = $this->cat_ancestors; echo ''; } $this->widget_end( $args ); } } PKh=\~j88class-wc-widget-layered-nav.phpnuW+Awidget_cssclass = 'woocommerce widget_layered_nav'; $this->widget_description = __( 'Shows a custom attribute in a widget which lets you narrow down the list of products when viewing product categories.', 'woocommerce' ); $this->widget_id = 'woocommerce_layered_nav'; $this->widget_name = __( 'WooCommerce Layered Nav', 'woocommerce' ); parent::__construct(); } /** * Updates a particular instance of a widget. * * @see WP_Widget->update * * @param array $new_instance * @param array $old_instance * * @return array */ public function update( $new_instance, $old_instance ) { $this->init_settings(); return parent::update( $new_instance, $old_instance ); } /** * Outputs the settings update form. * * @see WP_Widget->form * * @param array $instance */ public function form( $instance ) { $this->init_settings(); parent::form( $instance ); } /** * Init settings after post types are registered. */ public function init_settings() { $attribute_array = array(); $attribute_taxonomies = wc_get_attribute_taxonomies(); if ( ! empty( $attribute_taxonomies ) ) { foreach ( $attribute_taxonomies as $tax ) { if ( taxonomy_exists( wc_attribute_taxonomy_name( $tax->attribute_name ) ) ) { $attribute_array[ $tax->attribute_name ] = $tax->attribute_name; } } } $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Filter by', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ), 'attribute' => array( 'type' => 'select', 'std' => '', 'label' => __( 'Attribute', 'woocommerce' ), 'options' => $attribute_array ), 'display_type' => array( 'type' => 'select', 'std' => 'list', 'label' => __( 'Display type', 'woocommerce' ), 'options' => array( 'list' => __( 'List', 'woocommerce' ), 'dropdown' => __( 'Dropdown', 'woocommerce' ) ) ), 'query_type' => array( 'type' => 'select', 'std' => 'and', 'label' => __( 'Query type', 'woocommerce' ), 'options' => array( 'and' => __( 'AND', 'woocommerce' ), 'or' => __( 'OR', 'woocommerce' ) ) ), ); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { if ( ! is_post_type_archive( 'product' ) && ! is_tax( get_object_taxonomies( 'product' ) ) ) { return; } $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes(); $taxonomy = isset( $instance['attribute'] ) ? wc_attribute_taxonomy_name( $instance['attribute'] ) : $this->settings['attribute']['std']; $query_type = isset( $instance['query_type'] ) ? $instance['query_type'] : $this->settings['query_type']['std']; $display_type = isset( $instance['display_type'] ) ? $instance['display_type'] : $this->settings['display_type']['std']; if ( ! taxonomy_exists( $taxonomy ) ) { return; } $get_terms_args = array( 'hide_empty' => '1' ); $orderby = wc_attribute_orderby( $taxonomy ); switch ( $orderby ) { case 'name' : $get_terms_args['orderby'] = 'name'; $get_terms_args['menu_order'] = false; break; case 'id' : $get_terms_args['orderby'] = 'id'; $get_terms_args['order'] = 'ASC'; $get_terms_args['menu_order'] = false; break; case 'menu_order' : $get_terms_args['menu_order'] = 'ASC'; break; } $terms = get_terms( $taxonomy, $get_terms_args ); if ( 0 === sizeof( $terms ) ) { return; } switch ( $orderby ) { case 'name_num' : usort( $terms, '_wc_get_product_terms_name_num_usort_callback' ); break; case 'parent' : usort( $terms, '_wc_get_product_terms_parent_usort_callback' ); break; } ob_start(); $this->widget_start( $args, $instance ); if ( 'dropdown' === $display_type ) { $found = $this->layered_nav_dropdown( $terms, $taxonomy, $query_type ); } else { $found = $this->layered_nav_list( $terms, $taxonomy, $query_type ); } $this->widget_end( $args ); // Force found when option is selected - do not force found on taxonomy attributes if ( ! is_tax() && is_array( $_chosen_attributes ) && array_key_exists( $taxonomy, $_chosen_attributes ) ) { $found = true; } if ( ! $found ) { ob_end_clean(); } else { echo ob_get_clean(); } } /** * Return the currently viewed taxonomy name. * @return string */ protected function get_current_taxonomy() { return is_tax() ? get_queried_object()->taxonomy : ''; } /** * Return the currently viewed term ID. * @return int */ protected function get_current_term_id() { return absint( is_tax() ? get_queried_object()->term_id : 0 ); } /** * Return the currently viewed term slug. * @return int */ protected function get_current_term_slug() { return absint( is_tax() ? get_queried_object()->slug : 0 ); } /** * Show dropdown layered nav. * @param array $terms * @param string $taxonomy * @param string $query_type * @return bool Will nav display? */ protected function layered_nav_dropdown( $terms, $taxonomy, $query_type ) { $found = false; if ( $taxonomy !== $this->get_current_taxonomy() ) { $term_counts = $this->get_filtered_term_product_counts( wp_list_pluck( $terms, 'term_id' ), $taxonomy, $query_type ); $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes(); $taxonomy_filter_name = str_replace( 'pa_', '', $taxonomy ); echo ''; wc_enqueue_js( " jQuery( '.dropdown_layered_nav_". esc_js( $taxonomy_filter_name ) . "' ).change( function() { var slug = jQuery( this ).val(); location.href = '" . preg_replace( '%\/page\/[0-9]+%', '', str_replace( array( '&', '%2C' ), array( '&', ',' ), esc_js( add_query_arg( 'filtering', '1', remove_query_arg( array( 'page', 'filter_' . $taxonomy_filter_name ) ) ) ) ) ) . "&filter_". esc_js( $taxonomy_filter_name ) . "=' + slug; }); " ); } return $found; } /** * Get current page URL for layered nav items. * @return string */ protected function get_page_base_url( $taxonomy ) { if ( defined( 'SHOP_IS_ON_FRONT' ) ) { $link = home_url(); } elseif ( is_post_type_archive( 'product' ) || is_page( wc_get_page_id( 'shop' ) ) ) { $link = get_post_type_archive_link( 'product' ); } elseif ( is_product_category() ) { $link = get_term_link( get_query_var( 'product_cat' ), 'product_cat' ); } elseif ( is_product_tag() ) { $link = get_term_link( get_query_var( 'product_tag' ), 'product_tag' ); } else { $queried_object = get_queried_object(); $link = get_term_link( $queried_object->slug, $queried_object->taxonomy ); } // Min/Max if ( isset( $_GET['min_price'] ) ) { $link = add_query_arg( 'min_price', wc_clean( $_GET['min_price'] ), $link ); } if ( isset( $_GET['max_price'] ) ) { $link = add_query_arg( 'max_price', wc_clean( $_GET['max_price'] ), $link ); } // Orderby if ( isset( $_GET['orderby'] ) ) { $link = add_query_arg( 'orderby', wc_clean( $_GET['orderby'] ), $link ); } /** * Search Arg. * To support quote characters, first they are decoded from " entities, then URL encoded. */ if ( get_search_query() ) { $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link ); } // Post Type Arg if ( isset( $_GET['post_type'] ) ) { $link = add_query_arg( 'post_type', wc_clean( $_GET['post_type'] ), $link ); } // Min Rating Arg if ( isset( $_GET['min_rating'] ) ) { $link = add_query_arg( 'min_rating', wc_clean( $_GET['min_rating'] ), $link ); } // All current filters if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { foreach ( $_chosen_attributes as $name => $data ) { if ( $name === $taxonomy ) { continue; } $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) ); if ( ! empty( $data['terms'] ) ) { $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link ); } if ( 'or' == $data['query_type'] ) { $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link ); } } } return $link; } /** * Count products within certain terms, taking the main WP query into consideration. * @param array $term_ids * @param string $taxonomy * @param string $query_type * @return array */ protected function get_filtered_term_product_counts( $term_ids, $taxonomy, $query_type ) { global $wpdb; $tax_query = WC_Query::get_main_tax_query(); $meta_query = WC_Query::get_main_meta_query(); if ( 'or' === $query_type ) { foreach ( $tax_query as $key => $query ) { if ( $taxonomy === $query['taxonomy'] ) { unset( $tax_query[ $key ] ); } } } $meta_query = new WP_Meta_Query( $meta_query ); $tax_query = new WP_Tax_Query( $tax_query ); $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' ); $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' ); // Generate query $query = array(); $query['select'] = "SELECT COUNT( DISTINCT {$wpdb->posts}.ID ) as term_count, terms.term_id as term_count_id"; $query['from'] = "FROM {$wpdb->posts}"; $query['join'] = " INNER JOIN {$wpdb->term_relationships} AS term_relationships ON {$wpdb->posts}.ID = term_relationships.object_id INNER JOIN {$wpdb->term_taxonomy} AS term_taxonomy USING( term_taxonomy_id ) INNER JOIN {$wpdb->terms} AS terms USING( term_id ) " . $tax_query_sql['join'] . $meta_query_sql['join']; $query['where'] = " WHERE {$wpdb->posts}.post_type IN ( 'product' ) AND {$wpdb->posts}.post_status = 'publish' " . $tax_query_sql['where'] . $meta_query_sql['where'] . " AND terms.term_id IN (" . implode( ',', array_map( 'absint', $term_ids ) ) . ") "; if ( $search = WC_Query::get_main_search_query_sql() ) { $query['where'] .= ' AND ' . $search; } $query['group_by'] = "GROUP BY terms.term_id"; $query = apply_filters( 'woocommerce_get_filtered_term_product_counts_query', $query ); $query = implode( ' ', $query ); $results = $wpdb->get_results( $query ); return wp_list_pluck( $results, 'term_count', 'term_count_id' ); } /** * Show list based layered nav. * @param array $terms * @param string $taxonomy * @param string $query_type * @return bool Will nav display? */ protected function layered_nav_list( $terms, $taxonomy, $query_type ) { // List display echo ''; return $found; } } PKh=\%7!!"class-wc-widget-product-search.phpnuW+Awidget_cssclass = 'woocommerce widget_product_search'; $this->widget_description = __( 'A Search box for products only.', 'woocommerce' ); $this->widget_id = 'woocommerce_product_search'; $this->widget_name = __( 'WooCommerce Product Search', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => '', 'label' => __( 'Title', 'woocommerce' ) ) ); parent::__construct(); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { $this->widget_start( $args, $instance ); get_product_search_form(); $this->widget_end( $args ); } } PKYe\N+BB common.phpnuW+Astart_controls_section( '_section_style', [ 'label' => __( 'Advanced', 'elementor' ), 'tab' => Controls_Manager::TAB_ADVANCED, ] ); // Element Name for the Navigator $this->add_control( '_title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'render_type' => 'none', ] ); $this->add_responsive_control( '_margin', [ 'label' => __( 'Margin', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} > .elementor-widget-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( '_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} > .elementor-widget-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( '_z_index', [ 'label' => __( 'Z-Index', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'min' => 0, 'selectors' => [ '{{WRAPPER}}' => 'z-index: {{VALUE}};', ], 'separator' => 'before', ] ); $this->add_control( '_element_id', [ 'label' => __( 'CSS ID', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => '', 'title' => __( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ), 'style_transfer' => false, 'classes' => 'elementor-control-direction-ltr', ] ); $this->add_control( '_css_classes', [ 'label' => __( 'CSS Classes', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'prefix_class' => '', 'title' => __( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ), 'classes' => 'elementor-control-direction-ltr', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_effects', [ 'label' => __( 'Motion Effects', 'elementor' ), 'tab' => Controls_Manager::TAB_ADVANCED, ] ); $this->add_responsive_control( '_animation', [ 'label' => __( 'Entrance Animation', 'elementor' ), 'type' => Controls_Manager::ANIMATION, 'frontend_available' => true, ] ); $this->add_control( 'animation_duration', [ 'label' => __( 'Animation Duration', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ 'slow' => __( 'Slow', 'elementor' ), '' => __( 'Normal', 'elementor' ), 'fast' => __( 'Fast', 'elementor' ), ], 'prefix_class' => 'animated-', 'condition' => [ '_animation!' => '', ], ] ); $this->add_control( '_animation_delay', [ 'label' => __( 'Animation Delay', 'elementor' ) . ' (ms)', 'type' => Controls_Manager::NUMBER, 'default' => '', 'min' => 0, 'step' => 100, 'condition' => [ '_animation!' => '', ], 'render_type' => 'none', 'frontend_available' => true, ] ); $this->end_controls_section(); $this->start_controls_section( '_section_background', [ 'label' => __( 'Background', 'elementor' ), 'tab' => Controls_Manager::TAB_ADVANCED, ] ); $this->start_controls_tabs( '_tabs_background' ); $this->start_controls_tab( '_tab_background_normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => '_background', 'selector' => '{{WRAPPER}} > .elementor-widget-container', ] ); $this->end_controls_tab(); $this->start_controls_tab( '_tab_background_hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => '_background_hover', 'selector' => '{{WRAPPER}}:hover .elementor-widget-container', ] ); $this->add_control( '_background_hover_transition', [ 'label' => __( 'Transition Duration', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 3, 'step' => 0.1, ], ], 'render_type' => 'ui', 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} > .elementor-widget-container' => 'transition: background {{SIZE}}s', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( '_section_border', [ 'label' => __( 'Border', 'elementor' ), 'tab' => Controls_Manager::TAB_ADVANCED, ] ); $this->start_controls_tabs( '_tabs_border' ); $this->start_controls_tab( '_tab_border_normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => '_border', 'selector' => '{{WRAPPER}} > .elementor-widget-container', ] ); $this->add_responsive_control( '_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} > .elementor-widget-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => '_box_shadow', 'selector' => '{{WRAPPER}} > .elementor-widget-container', ] ); $this->end_controls_tab(); $this->start_controls_tab( '_tab_border_hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => '_border_hover', 'selector' => '{{WRAPPER}}:hover .elementor-widget-container', ] ); $this->add_responsive_control( '_border_radius_hover', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}}:hover > .elementor-widget-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => '_box_shadow_hover', 'selector' => '{{WRAPPER}}:hover .elementor-widget-container', ] ); $this->add_control( '_border_hover_transition', [ 'label' => __( 'Transition Duration', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'separator' => 'before', 'range' => [ 'px' => [ 'max' => 3, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-widget-container' => 'transition: background {{_background_hover_transition.SIZE}}s, border {{SIZE}}s, border-radius {{SIZE}}s, box-shadow {{SIZE}}s', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( '_section_position', [ 'label' => __( 'Positioning', 'elementor' ), 'tab' => Controls_Manager::TAB_ADVANCED, ] ); $this->add_responsive_control( '_element_width', [ 'label' => __( 'Width', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'Default', 'elementor' ), 'inherit' => __( 'Full Width', 'elementor' ) . ' (100%)', 'auto' => __( 'Inline', 'elementor' ) . ' (auto)', 'initial' => __( 'Custom', 'elementor' ), ], 'selectors_dictionary' => [ 'inherit' => '100%', ], 'prefix_class' => 'elementor-widget%s__width-', 'selectors' => [ '{{WRAPPER}}' => 'width: {{VALUE}}; max-width: {{VALUE}}', ], ] ); $this->add_responsive_control( '_element_custom_width', [ 'label' => __( 'Custom Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 1000, 'step' => 1, ], '%' => [ 'max' => 100, 'step' => 1, ], ], 'condition' => [ '_element_width' => 'initial', ], 'device_args' => [ Controls_Stack::RESPONSIVE_TABLET => [ 'condition' => [ '_element_width_tablet' => [ 'initial' ], ], ], Controls_Stack::RESPONSIVE_MOBILE => [ 'condition' => [ '_element_width_mobile' => [ 'initial' ], ], ], ], 'size_units' => [ 'px', '%', 'vw' ], 'selectors' => [ '{{WRAPPER}}' => 'width: {{SIZE}}{{UNIT}}; max-width: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( '_element_vertical_align', [ 'label' => __( 'Vertical Align', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => __( 'Start', 'elementor' ), 'icon' => 'eicon-v-align-top', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-v-align-middle', ], 'flex-end' => [ 'title' => __( 'End', 'elementor' ), 'icon' => 'eicon-v-align-bottom', ], ], 'condition' => [ '_element_width!' => '', '_position' => '', ], 'selectors' => [ '{{WRAPPER}}' => 'align-self: {{VALUE}}', ], ] ); $this->add_control( '_position_description', [ 'raw' => '' . __( 'Please note!', 'elementor' ) . ' ' . __( 'Custom positioning is not considered best practice for responsive web design and should not be used too frequently.', 'elementor' ), 'type' => Controls_Manager::RAW_HTML, 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', 'render_type' => 'ui', 'condition' => [ '_position!' => '', ], ] ); $this->add_control( '_position', [ 'label' => __( 'Position', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'Default', 'elementor' ), 'absolute' => __( 'Absolute', 'elementor' ), 'fixed' => __( 'Fixed', 'elementor' ), ], 'prefix_class' => 'elementor-', 'frontend_available' => true, ] ); $start = is_rtl() ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' ); $end = ! is_rtl() ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' ); $this->add_control( '_offset_orientation_h', [ 'label' => __( 'Horizontal Orientation', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'toggle' => false, 'default' => 'start', 'options' => [ 'start' => [ 'title' => $start, 'icon' => 'eicon-h-align-left', ], 'end' => [ 'title' => $end, 'icon' => 'eicon-h-align-right', ], ], 'classes' => 'elementor-control-start-end', 'render_type' => 'ui', 'condition' => [ '_position!' => '', ], ] ); $this->add_responsive_control( '_offset_x', [ 'label' => __( 'Offset', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => -1000, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => -200, 'max' => 200, ], 'vw' => [ 'min' => -200, 'max' => 200, ], 'vh' => [ 'min' => -200, 'max' => 200, ], ], 'default' => [ 'size' => '0', ], 'size_units' => [ 'px', '%', 'vw', 'vh' ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}', 'body.rtl {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}', ], 'condition' => [ '_offset_orientation_h!' => 'end', '_position!' => '', ], ] ); $this->add_responsive_control( '_offset_x_end', [ 'label' => __( 'Offset', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => -1000, 'max' => 1000, 'step' => 0.1, ], '%' => [ 'min' => -200, 'max' => 200, ], 'vw' => [ 'min' => -200, 'max' => 200, ], 'vh' => [ 'min' => -200, 'max' => 200, ], ], 'default' => [ 'size' => '0', ], 'size_units' => [ 'px', '%', 'vw', 'vh' ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}}' => 'right: {{SIZE}}{{UNIT}}', 'body.rtl {{WRAPPER}}' => 'left: {{SIZE}}{{UNIT}}', ], 'condition' => [ '_offset_orientation_h' => 'end', '_position!' => '', ], ] ); $this->add_control( '_offset_orientation_v', [ 'label' => __( 'Vertical Orientation', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'toggle' => false, 'default' => 'start', 'options' => [ 'start' => [ 'title' => __( 'Top', 'elementor' ), 'icon' => 'eicon-v-align-top', ], 'end' => [ 'title' => __( 'Bottom', 'elementor' ), 'icon' => 'eicon-v-align-bottom', ], ], 'render_type' => 'ui', 'condition' => [ '_position!' => '', ], ] ); $this->add_responsive_control( '_offset_y', [ 'label' => __( 'Offset', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => -1000, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => -200, 'max' => 200, ], 'vh' => [ 'min' => -200, 'max' => 200, ], 'vw' => [ 'min' => -200, 'max' => 200, ], ], 'size_units' => [ 'px', '%', 'vh', 'vw' ], 'default' => [ 'size' => '0', ], 'selectors' => [ '{{WRAPPER}}' => 'top: {{SIZE}}{{UNIT}}', ], 'condition' => [ '_offset_orientation_v!' => 'end', '_position!' => '', ], ] ); $this->add_responsive_control( '_offset_y_end', [ 'label' => __( 'Offset', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => -1000, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => -200, 'max' => 200, ], 'vh' => [ 'min' => -200, 'max' => 200, ], 'vw' => [ 'min' => -200, 'max' => 200, ], ], 'size_units' => [ 'px', '%', 'vh', 'vw' ], 'default' => [ 'size' => '0', ], 'selectors' => [ '{{WRAPPER}}' => 'bottom: {{SIZE}}{{UNIT}}', ], 'condition' => [ '_offset_orientation_v' => 'end', '_position!' => '', ], ] ); $this->end_controls_section(); $this->start_controls_section( '_section_responsive', [ 'label' => __( 'Responsive', 'elementor' ), 'tab' => Controls_Manager::TAB_ADVANCED, ] ); $this->add_control( 'responsive_description', [ 'raw' => __( 'Responsive visibility will take effect only on preview or live page, and not while editing in Elementor.', 'elementor' ), 'type' => Controls_Manager::RAW_HTML, 'content_classes' => 'elementor-descriptor', ] ); $this->add_control( 'hide_desktop', [ 'label' => __( 'Hide On Desktop', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'prefix_class' => 'elementor-', 'label_on' => 'Hide', 'label_off' => 'Show', 'return_value' => 'hidden-desktop', ] ); $this->add_control( 'hide_tablet', [ 'label' => __( 'Hide On Tablet', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'prefix_class' => 'elementor-', 'label_on' => 'Hide', 'label_off' => 'Show', 'return_value' => 'hidden-tablet', ] ); $this->add_control( 'hide_mobile', [ 'label' => __( 'Hide On Mobile', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'prefix_class' => 'elementor-', 'label_on' => 'Hide', 'label_off' => 'Show', 'return_value' => 'hidden-phone', ] ); $this->end_controls_section(); Plugin::$instance->controls_manager->add_custom_attributes_controls( $this ); Plugin::$instance->controls_manager->add_custom_css_controls( $this ); } } PKYe\V== image-box.phpnuW+Astart_controls_section( 'section_image', [ 'label' => __( 'Image Box', 'elementor' ), ] ); $this->add_control( 'image', [ 'label' => __( 'Choose Image', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'thumbnail', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. 'default' => 'full', 'separator' => 'none', ] ); $this->add_control( 'title_text', [ 'label' => __( 'Title & Description', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => __( 'This is the heading', 'elementor' ), 'placeholder' => __( 'Enter your title', 'elementor' ), 'label_block' => true, ] ); $this->add_control( 'description_text', [ 'label' => __( 'Content', 'elementor' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), 'placeholder' => __( 'Enter your description', 'elementor' ), 'separator' => 'none', 'rows' => 10, 'show_label' => false, ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), 'separator' => 'before', ] ); $this->add_control( 'position', [ 'label' => __( 'Image Position', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'top', 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'top' => [ 'title' => __( 'Top', 'elementor' ), 'icon' => 'eicon-v-align-top', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'prefix_class' => 'elementor-position-', 'toggle' => false, ] ); $this->add_control( 'title_size', [ 'label' => __( 'Title HTML Tag', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ], 'default' => 'h3', ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_image', [ 'label' => __( 'Image', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'image_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 15, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}}.elementor-position-right .elementor-image-box-img' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}}.elementor-position-left .elementor-image-box-img' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}}.elementor-position-top .elementor-image-box-img' => 'margin-bottom: {{SIZE}}{{UNIT}};', '(mobile){{WRAPPER}} .elementor-image-box-img' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'image_size', [ 'label' => __( 'Width', 'elementor' ) . ' (%)', 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 30, 'unit' => '%', ], 'tablet_default' => [ 'unit' => '%', ], 'mobile_default' => [ 'unit' => '%', ], 'size_units' => [ '%' ], 'range' => [ '%' => [ 'min' => 5, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image-box-wrapper .elementor-image-box-img' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'hover_animation', [ 'label' => __( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->start_controls_tabs( 'image_effects' ); $this->start_controls_tab( 'normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'css_filters', 'selector' => '{{WRAPPER}} .elementor-image-box-img img', ] ); $this->add_control( 'image_opacity', [ 'label' => __( 'Opacity', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 1, 'min' => 0.10, 'step' => 0.01, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image-box-img img' => 'opacity: {{SIZE}};', ], ] ); $this->add_control( 'background_hover_transition', [ 'label' => __( 'Transition Duration', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0.3, ], 'range' => [ 'px' => [ 'max' => 3, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image-box-img img' => 'transition-duration: {{SIZE}}s', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'css_filters_hover', 'selector' => '{{WRAPPER}}:hover .elementor-image-box-img img', ] ); $this->add_control( 'image_opacity_hover', [ 'label' => __( 'Opacity', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 1, 'min' => 0.10, 'step' => 0.01, ], ], 'selectors' => [ '{{WRAPPER}}:hover .elementor-image-box-img img' => 'opacity: {{SIZE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); $this->start_controls_section( 'section_style_content', [ 'label' => __( 'Content', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'text_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image-box-wrapper' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'content_vertical_alignment', [ 'label' => __( 'Vertical Alignment', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'top' => __( 'Top', 'elementor' ), 'middle' => __( 'Middle', 'elementor' ), 'bottom' => __( 'Bottom', 'elementor' ), ], 'default' => 'top', 'prefix_class' => 'elementor-vertical-align-', ] ); $this->add_control( 'heading_title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'title_bottom_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image-box-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'title_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-image-box-content .elementor-image-box-title' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .elementor-image-box-content .elementor-image-box-title', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, ] ); $this->add_control( 'heading_description', [ 'label' => __( 'Description', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'description_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-image-box-content .elementor-image-box-description' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'description_typography', 'selector' => '{{WRAPPER}} .elementor-image-box-content .elementor-image-box-description', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); } /** * Render image box widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $has_content = ! Utils::is_empty( $settings['title_text'] ) || ! Utils::is_empty( $settings['description_text'] ); $html = '
'; if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'link', $settings['link'] ); } if ( ! empty( $settings['image']['url'] ) ) { $this->add_render_attribute( 'image', 'src', $settings['image']['url'] ); $this->add_render_attribute( 'image', 'alt', Control_Media::get_image_alt( $settings['image'] ) ); $this->add_render_attribute( 'image', 'title', Control_Media::get_image_title( $settings['image'] ) ); if ( $settings['hover_animation'] ) { $this->add_render_attribute( 'image', 'class', 'elementor-animation-' . $settings['hover_animation'] ); } $image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image' ); if ( ! empty( $settings['link']['url'] ) ) { $image_html = 'get_render_attribute_string( 'link' ) . '>' . $image_html . ''; } $html .= '
' . $image_html . '
'; } if ( $has_content ) { $html .= '
'; if ( ! Utils::is_empty( $settings['title_text'] ) ) { $this->add_render_attribute( 'title_text', 'class', 'elementor-image-box-title' ); $this->add_inline_editing_attributes( 'title_text', 'none' ); $title_html = $settings['title_text']; if ( ! empty( $settings['link']['url'] ) ) { $title_html = 'get_render_attribute_string( 'link' ) . '>' . $title_html . ''; } $html .= sprintf( '<%1$s %2$s>%3$s', $settings['title_size'], $this->get_render_attribute_string( 'title_text' ), $title_html ); } if ( ! Utils::is_empty( $settings['description_text'] ) ) { $this->add_render_attribute( 'description_text', 'class', 'elementor-image-box-description' ); $this->add_inline_editing_attributes( 'description_text' ); $html .= sprintf( '

%2$s

', $this->get_render_attribute_string( 'description_text' ), $settings['description_text'] ); } $html .= '
'; } $html .= '
'; echo $html; } /** * Render image box widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() { ?> <# var html = '
'; if ( settings.image.url ) { var image = { id: settings.image.id, url: settings.image.url, size: settings.thumbnail_size, dimension: settings.thumbnail_custom_dimension, model: view.getEditModel() }; var image_url = elementor.imagesManager.getImageUrl( image ); var imageHtml = ''; if ( settings.link.url ) { imageHtml = '' + imageHtml + ''; } html += '
' + imageHtml + '
'; } var hasContent = !! ( settings.title_text || settings.description_text ); if ( hasContent ) { html += '
'; if ( settings.title_text ) { var title_html = settings.title_text; if ( settings.link.url ) { title_html = '' + title_html + ''; } view.addRenderAttribute( 'title_text', 'class', 'elementor-image-box-title' ); view.addInlineEditingAttributes( 'title_text', 'none' ); html += '<' + settings.title_size + ' ' + view.getRenderAttributeString( 'title_text' ) + '>' + title_html + ''; } if ( settings.description_text ) { view.addRenderAttribute( 'description_text', 'class', 'elementor-image-box-description' ); view.addInlineEditingAttributes( 'description_text' ); html += '

' + settings.description_text + '

'; } html += '
'; } html += '
'; print( html ); #> -CC accordion.phpnuW+Astart_controls_section( 'section_title', [ 'label' => __( 'Accordion', 'elementor' ), ] ); $repeater = new Repeater(); $repeater->add_control( 'tab_title', [ 'label' => __( 'Title & Description', 'elementor' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Accordion Title', 'elementor' ), 'dynamic' => [ 'active' => true, ], 'label_block' => true, ] ); $repeater->add_control( 'tab_content', [ 'label' => __( 'Content', 'elementor' ), 'type' => Controls_Manager::WYSIWYG, 'default' => __( 'Accordion Content', 'elementor' ), 'show_label' => false, ] ); $this->add_control( 'tabs', [ 'label' => __( 'Accordion Items', 'elementor' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'tab_title' => __( 'Accordion #1', 'elementor' ), 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), ], [ 'tab_title' => __( 'Accordion #2', 'elementor' ), 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), ], ], 'title_field' => '{{{ tab_title }}}', ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->add_control( 'selected_icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'separator' => 'before', 'fa4compatibility' => 'icon', 'default' => [ 'value' => 'fas fa-plus', 'library' => 'fa-solid', ], 'recommended' => [ 'fa-solid' => [ 'chevron-down', 'angle-down', 'angle-double-down', 'caret-down', 'caret-square-down', ], 'fa-regular' => [ 'caret-square-down', ], ], 'skin' => 'inline', 'label_block' => false, ] ); $this->add_control( 'selected_active_icon', [ 'label' => __( 'Active Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon_active', 'default' => [ 'value' => 'fas fa-minus', 'library' => 'fa-solid', ], 'recommended' => [ 'fa-solid' => [ 'chevron-up', 'angle-up', 'angle-double-up', 'caret-up', 'caret-square-up', ], 'fa-regular' => [ 'caret-square-up', ], ], 'skin' => 'inline', 'label_block' => false, 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->add_control( 'title_html_tag', [ 'label' => __( 'Title HTML Tag', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', ], 'default' => 'div', 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title_style', [ 'label' => __( 'Accordion', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'border_width', [ 'label' => __( 'Border Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-accordion-item' => 'border-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-content' => 'border-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'border_color', [ 'label' => __( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-accordion-item' => 'border-color: {{VALUE}};', '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-content' => 'border-top-color: {{VALUE}};', '{{WRAPPER}} .elementor-accordion .elementor-accordion-item .elementor-tab-title.elementor-active' => 'border-bottom-color: {{VALUE}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_toggle_style_title', [ 'label' => __( 'Title', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_background', [ 'label' => __( 'Background', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-tab-title' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'title_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-accordion-icon, {{WRAPPER}} .elementor-accordion-title' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_control( 'tab_active_color', [ 'label' => __( 'Active Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-active .elementor-accordion-icon, {{WRAPPER}} .elementor-active .elementor-accordion-title' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_4, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .elementor-accordion .elementor-accordion-title', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, ] ); $this->add_responsive_control( 'title_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-tab-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_toggle_style_icon', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->add_control( 'icon_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Start', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'right' => [ 'title' => __( 'End', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => is_rtl() ? 'right' : 'left', 'toggle' => false, ] ); $this->add_control( 'icon_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-tab-title .elementor-accordion-icon i:before' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-accordion .elementor-tab-title .elementor-accordion-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_active_color', [ 'label' => __( 'Active Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-tab-title.elementor-active .elementor-accordion-icon i:before' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-accordion .elementor-tab-title.elementor-active .elementor-accordion-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-accordion-icon.elementor-accordion-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-accordion .elementor-accordion-icon.elementor-accordion-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_toggle_style_content', [ 'label' => __( 'Content', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'content_background_color', [ 'label' => __( 'Background', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-tab-content' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'content_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-tab-content' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .elementor-accordion .elementor-tab-content', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->add_responsive_control( 'content_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-accordion .elementor-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } /** * Render accordion widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $migrated = isset( $settings['__fa4_migrated']['selected_icon'] ); if ( ! isset( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) { // @todo: remove when deprecated // added as bc in 2.6 // add old default $settings['icon'] = 'fa fa-plus'; $settings['icon_active'] = 'fa fa-minus'; $settings['icon_align'] = $this->get_settings( 'icon_align' ); } $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); $has_icon = ( ! $is_new || ! empty( $settings['selected_icon']['value'] ) ); $id_int = substr( $this->get_id_int(), 0, 3 ); ?>
$item ) : $tab_count = $index + 1; $tab_title_setting_key = $this->get_repeater_setting_key( 'tab_title', 'tabs', $index ); $tab_content_setting_key = $this->get_repeater_setting_key( 'tab_content', 'tabs', $index ); $this->add_render_attribute( $tab_title_setting_key, [ 'id' => 'elementor-tab-title-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-title' ], 'data-tab' => $tab_count, 'role' => 'tab', 'aria-controls' => 'elementor-tab-content-' . $id_int . $tab_count, ] ); $this->add_render_attribute( $tab_content_setting_key, [ 'id' => 'elementor-tab-content-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-content', 'elementor-clearfix' ], 'data-tab' => $tab_count, 'role' => 'tabpanel', 'aria-labelledby' => 'elementor-tab-title-' . $id_int . $tab_count, ] ); $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); ?>
< get_render_attribute_string( $tab_title_setting_key ); ?>> >
get_render_attribute_string( $tab_content_setting_key ); ?>>parse_text_editor( $item['tab_content'] ); ?>
<# if ( settings.tabs ) { var tabindex = view.getIDInt().toString().substr( 0, 3 ), iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, {}, 'i' , 'object' ), iconActiveHTML = elementor.helpers.renderIcon( view, settings.selected_active_icon, {}, 'i' , 'object' ), migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ); _.each( settings.tabs, function( item, index ) { var tabCount = index + 1, tabTitleKey = view.getRepeaterSettingKey( 'tab_title', 'tabs', index ), tabContentKey = view.getRepeaterSettingKey( 'tab_content', 'tabs', index ); view.addRenderAttribute( tabTitleKey, { 'id': 'elementor-tab-title-' + tabindex + tabCount, 'class': [ 'elementor-tab-title' ], 'tabindex': tabindex + tabCount, 'data-tab': tabCount, 'role': 'tab', 'aria-controls': 'elementor-tab-content-' + tabindex + tabCount } ); view.addRenderAttribute( tabContentKey, { 'id': 'elementor-tab-content-' + tabindex + tabCount, 'class': [ 'elementor-tab-content', 'elementor-clearfix' ], 'data-tab': tabCount, 'role': 'tabpanel', 'aria-labelledby': 'elementor-tab-title-' + tabindex + tabCount } ); view.addInlineEditingAttributes( tabContentKey, 'advanced' ); #>
<{{{ settings.title_html_tag }}} {{{ view.getRenderAttributeString( tabTitleKey ) }}}> <# if ( settings.icon || settings.selected_icon ) { #> <# } #> {{{ item.tab_title }}}
{{{ item.tab_content }}}
<# } ); } #>
start_controls_section( 'section_image_carousel', [ 'label' => __( 'Image Carousel', 'elementor' ), ] ); $this->add_control( 'carousel', [ 'label' => __( 'Add Images', 'elementor' ), 'type' => Controls_Manager::GALLERY, 'default' => [], 'show_label' => false, 'dynamic' => [ 'active' => true, ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'thumbnail', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. 'separator' => 'none', ] ); $slides_to_show = range( 1, 10 ); $slides_to_show = array_combine( $slides_to_show, $slides_to_show ); $this->add_responsive_control( 'slides_to_show', [ 'label' => __( 'Slides to Show', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Default', 'elementor' ), ] + $slides_to_show, 'frontend_available' => true, ] ); $this->add_responsive_control( 'slides_to_scroll', [ 'label' => __( 'Slides to Scroll', 'elementor' ), 'type' => Controls_Manager::SELECT, 'description' => __( 'Set how many slides are scrolled per swipe.', 'elementor' ), 'options' => [ '' => __( 'Default', 'elementor' ), ] + $slides_to_show, 'condition' => [ 'slides_to_show!' => '1', ], 'frontend_available' => true, ] ); $this->add_control( 'image_stretch', [ 'label' => __( 'Image Stretch', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'no', 'options' => [ 'no' => __( 'No', 'elementor' ), 'yes' => __( 'Yes', 'elementor' ), ], ] ); $this->add_control( 'navigation', [ 'label' => __( 'Navigation', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'both', 'options' => [ 'both' => __( 'Arrows and Dots', 'elementor' ), 'arrows' => __( 'Arrows', 'elementor' ), 'dots' => __( 'Dots', 'elementor' ), 'none' => __( 'None', 'elementor' ), ], 'frontend_available' => true, ] ); $this->add_control( 'link_to', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'none', 'options' => [ 'none' => __( 'None', 'elementor' ), 'file' => __( 'Media File', 'elementor' ), 'custom' => __( 'Custom URL', 'elementor' ), ], ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'elementor' ), 'condition' => [ 'link_to' => 'custom', ], 'show_label' => false, ] ); $this->add_control( 'open_lightbox', [ 'label' => __( 'Lightbox', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => __( 'Default', 'elementor' ), 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], 'condition' => [ 'link_to' => 'file', ], ] ); $this->add_control( 'caption_type', [ 'label' => __( 'Caption', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'None', 'elementor' ), 'title' => __( 'Title', 'elementor' ), 'caption' => __( 'Caption', 'elementor' ), 'description' => __( 'Description', 'elementor' ), ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_additional_options', [ 'label' => __( 'Additional Options', 'elementor' ), ] ); $this->add_control( 'autoplay', [ 'label' => __( 'Autoplay', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'yes', 'options' => [ 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], 'frontend_available' => true, ] ); $this->add_control( 'pause_on_hover', [ 'label' => __( 'Pause on Hover', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'yes', 'options' => [ 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], 'condition' => [ 'autoplay' => 'yes', ], 'frontend_available' => true, ] ); $this->add_control( 'pause_on_interaction', [ 'label' => __( 'Pause on Interaction', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'yes', 'options' => [ 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], 'condition' => [ 'autoplay' => 'yes', ], 'frontend_available' => true, ] ); $this->add_control( 'autoplay_speed', [ 'label' => __( 'Autoplay Speed', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'default' => 5000, 'condition' => [ 'autoplay' => 'yes', ], 'frontend_available' => true, ] ); $this->add_control( 'infinite', [ 'label' => __( 'Infinite Loop', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'yes', 'options' => [ 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], 'frontend_available' => true, ] ); $this->add_control( 'effect', [ 'label' => __( 'Effect', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'slide', 'options' => [ 'slide' => __( 'Slide', 'elementor' ), 'fade' => __( 'Fade', 'elementor' ), ], 'condition' => [ 'slides_to_show' => '1', ], 'frontend_available' => true, ] ); $this->add_control( 'speed', [ 'label' => __( 'Animation Speed', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'default' => 500, 'frontend_available' => true, ] ); $this->add_control( 'direction', [ 'label' => __( 'Direction', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'ltr', 'options' => [ 'ltr' => __( 'Left', 'elementor' ), 'rtl' => __( 'Right', 'elementor' ), ], 'frontend_available' => true, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_navigation', [ 'label' => __( 'Navigation', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'navigation' => [ 'arrows', 'dots', 'both' ], ], ] ); $this->add_control( 'heading_style_arrows', [ 'label' => __( 'Arrows', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'navigation' => [ 'arrows', 'both' ], ], ] ); $this->add_control( 'arrows_position', [ 'label' => __( 'Position', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'inside', 'options' => [ 'inside' => __( 'Inside', 'elementor' ), 'outside' => __( 'Outside', 'elementor' ), ], 'prefix_class' => 'elementor-arrows-position-', 'condition' => [ 'navigation' => [ 'arrows', 'both' ], ], ] ); $this->add_control( 'arrows_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 20, 'max' => 60, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-swiper-button.elementor-swiper-button-prev, {{WRAPPER}} .elementor-swiper-button.elementor-swiper-button-next' => 'font-size: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'navigation' => [ 'arrows', 'both' ], ], ] ); $this->add_control( 'arrows_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-swiper-button.elementor-swiper-button-prev, {{WRAPPER}} .elementor-swiper-button.elementor-swiper-button-next' => 'color: {{VALUE}};', ], 'condition' => [ 'navigation' => [ 'arrows', 'both' ], ], ] ); $this->add_control( 'heading_style_dots', [ 'label' => __( 'Dots', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'navigation' => [ 'dots', 'both' ], ], ] ); $this->add_control( 'dots_position', [ 'label' => __( 'Position', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'outside', 'options' => [ 'outside' => __( 'Outside', 'elementor' ), 'inside' => __( 'Inside', 'elementor' ), ], 'prefix_class' => 'elementor-pagination-position-', 'condition' => [ 'navigation' => [ 'dots', 'both' ], ], ] ); $this->add_control( 'dots_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 5, 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}} .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'navigation' => [ 'dots', 'both' ], ], ] ); $this->add_control( 'dots_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .swiper-pagination-bullet' => 'background: {{VALUE}};', ], 'condition' => [ 'navigation' => [ 'dots', 'both' ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_image', [ 'label' => __( 'Image', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'gallery_vertical_align', [ 'label' => __( 'Vertical Align', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => __( 'Start', 'elementor' ), 'icon' => 'eicon-v-align-top', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-v-align-middle', ], 'flex-end' => [ 'title' => __( 'End', 'elementor' ), 'icon' => 'eicon-v-align-bottom', ], ], 'condition' => [ 'slides_to_show!' => '1', ], 'selectors' => [ '{{WRAPPER}} .swiper-wrapper' => 'display: flex; align-items: {{VALUE}};', ], ] ); $this->add_control( 'image_spacing', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Default', 'elementor' ), 'custom' => __( 'Custom', 'elementor' ), ], 'default' => '', 'condition' => [ 'slides_to_show!' => '1', ], ] ); $this->add_control( 'image_spacing_custom', [ 'label' => __( 'Image Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 100, ], ], 'default' => [ 'size' => 20, ], 'show_label' => false, 'condition' => [ 'image_spacing' => 'custom', 'slides_to_show!' => '1', ], 'frontend_available' => true, 'render_type' => 'none', 'separator' => 'after', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border', 'selector' => '{{WRAPPER}} .elementor-image-carousel-wrapper .elementor-image-carousel .swiper-slide-image', ] ); $this->add_control( 'image_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-image-carousel-wrapper .elementor-image-carousel .swiper-slide-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_caption', [ 'label' => __( 'Caption', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'caption_type!' => '', ], ] ); $this->add_control( 'caption_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .elementor-image-carousel-caption' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'caption_text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-image-carousel-caption' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'caption_typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_4, 'selector' => '{{WRAPPER}} .elementor-image-carousel-caption', ] ); $this->end_controls_section(); } /** * Render image carousel widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); if ( empty( $settings['carousel'] ) ) { return; } $slides = []; foreach ( $settings['carousel'] as $index => $attachment ) { $image_url = Group_Control_Image_Size::get_attachment_image_src( $attachment['id'], 'thumbnail', $settings ); $image_html = '' . esc_attr( Control_Media::get_image_alt( $attachment ) ) . ''; $link_tag = ''; $link = $this->get_link_url( $attachment, $settings ); if ( $link ) { $link_key = 'link_' . $index; $this->add_lightbox_data_attributes( $link_key, $attachment['id'], $settings['open_lightbox'], $this->get_id() ); if ( Plugin::$instance->editor->is_edit_mode() ) { $this->add_render_attribute( $link_key, [ 'class' => 'elementor-clickable', ] ); } $this->add_link_attributes( $link_key, $link ); $link_tag = 'get_render_attribute_string( $link_key ) . '>'; } $image_caption = $this->get_image_caption( $attachment ); $slide_html = ''; $slides[] = $slide_html; } if ( empty( $slides ) ) { return; } $this->add_render_attribute( [ 'carousel' => [ 'class' => 'elementor-image-carousel swiper-wrapper', ], 'carousel-wrapper' => [ 'class' => 'elementor-image-carousel-wrapper swiper-container', 'dir' => $settings['direction'], ], ] ); $show_dots = ( in_array( $settings['navigation'], [ 'dots', 'both' ] ) ); $show_arrows = ( in_array( $settings['navigation'], [ 'arrows', 'both' ] ) ); if ( 'yes' === $settings['image_stretch'] ) { $this->add_render_attribute( 'carousel', 'class', 'swiper-image-stretch' ); } $slides_count = count( $settings['carousel'] ); ?>
get_render_attribute_string( 'carousel-wrapper' ); ?>>
get_render_attribute_string( 'carousel' ); ?>>
wp_get_attachment_url( $attachment['id'] ), ]; } /** * Retrieve image carousel caption. * * @since 1.2.0 * @access private * * @param array $attachment * * @return string The caption of the image. */ private function get_image_caption( $attachment ) { $caption_type = $this->get_settings_for_display( 'caption_type' ); if ( empty( $caption_type ) ) { return ''; } $attachment_post = get_post( $attachment['id'] ); if ( 'caption' === $caption_type ) { return $attachment_post->post_excerpt; } if ( 'title' === $caption_type ) { return $attachment_post->post_title; } return $attachment_post->post_content; } } PKYe\"7Nnn audio.phpnuW+Astart_controls_section( 'section_audio', [ 'label' => __( 'SoundCloud', 'elementor' ), ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::URL_CATEGORY, ], ], 'default' => [ 'url' => 'https://soundcloud.com/shchxango/john-coltrane-1963-my-favorite', ], 'options' => false, ] ); $this->add_control( 'visual', [ 'label' => __( 'Visual Player', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'no', 'options' => [ 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], ] ); $this->add_control( 'sc_options', [ 'label' => __( 'Additional Options', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'sc_auto_play', [ 'label' => __( 'Autoplay', 'elementor' ), 'type' => Controls_Manager::SWITCHER, ] ); $this->add_control( 'sc_buying', [ 'label' => __( 'Buy Button', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', ] ); $this->add_control( 'sc_liking', [ 'label' => __( 'Like Button', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', ] ); $this->add_control( 'sc_download', [ 'label' => __( 'Download Button', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', ] ); $this->add_control( 'sc_show_artwork', [ 'label' => __( 'Artwork', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', 'condition' => [ 'visual' => 'no', ], ] ); $this->add_control( 'sc_sharing', [ 'label' => __( 'Share Button', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', ] ); $this->add_control( 'sc_show_comments', [ 'label' => __( 'Comments', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', ] ); $this->add_control( 'sc_show_playcount', [ 'label' => __( 'Play Counts', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', ] ); $this->add_control( 'sc_show_user', [ 'label' => __( 'Username', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', ] ); $this->add_control( 'sc_color', [ 'label' => __( 'Controls Color', 'elementor' ), 'type' => Controls_Manager::COLOR, ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'soundcloud', ] ); $this->end_controls_section(); } /** * Render audio widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); if ( empty( $settings['link'] ) ) { return; } $this->_current_instance = $settings; add_filter( 'oembed_result', [ $this, 'filter_oembed_result' ], 50, 3 ); $video_html = wp_oembed_get( $settings['link']['url'], wp_embed_defaults() ); remove_filter( 'oembed_result', [ $this, 'filter_oembed_result' ], 50 ); if ( $video_html ) : ?>
_current_instance[ 'sc_' . $param_key ] ? 'true' : 'false'; } $params['color'] = str_replace( '#', '', $this->_current_instance['sc_color'] ); preg_match( '/<\/iframe>/isU', $html, $matches ); $url = esc_url( add_query_arg( $params, $matches[1] ) ); $visual = 'yes' === $this->_current_instance['visual'] ? 'true' : 'false'; $html = str_replace( [ $matches[1], 'visual=true' ], [ $url, 'visual=' . $visual ], $html ); if ( 'false' === $visual ) { $html = str_replace( 'height="400"', 'height="200"', $html ); } return $html; } /** * Render audio widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() {} } PKYe\~DD toggle.phpnuW+Astart_controls_section( 'section_toggle', [ 'label' => __( 'Toggle', 'elementor' ), ] ); $repeater = new Repeater(); $repeater->add_control( 'tab_title', [ 'label' => __( 'Title & Description', 'elementor' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Toggle Title', 'elementor' ), 'label_block' => true, 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'tab_content', [ 'label' => __( 'Content', 'elementor' ), 'type' => Controls_Manager::WYSIWYG, 'default' => __( 'Toggle Content', 'elementor' ), 'show_label' => false, ] ); $this->add_control( 'tabs', [ 'label' => __( 'Toggle Items', 'elementor' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'tab_title' => __( 'Toggle #1', 'elementor' ), 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), ], [ 'tab_title' => __( 'Toggle #2', 'elementor' ), 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), ], ], 'title_field' => '{{{ tab_title }}}', ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->add_control( 'selected_icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'separator' => 'before', 'fa4compatibility' => 'icon', 'default' => [ 'value' => 'fas fa-caret' . ( is_rtl() ? '-left' : '-right' ), 'library' => 'fa-solid', ], 'recommended' => [ 'fa-solid' => [ 'chevron-down', 'angle-down', 'angle-double-down', 'caret-down', 'caret-square-down', ], 'fa-regular' => [ 'caret-square-down', ], ], 'label_block' => false, 'skin' => 'inline', ] ); $this->add_control( 'selected_active_icon', [ 'label' => __( 'Active Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon_active', 'default' => [ 'value' => 'fas fa-caret-up', 'library' => 'fa-solid', ], 'recommended' => [ 'fa-solid' => [ 'chevron-up', 'angle-up', 'angle-double-up', 'caret-up', 'caret-square-up', ], 'fa-regular' => [ 'caret-square-up', ], ], 'skin' => 'inline', 'label_block' => false, 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->add_control( 'title_html_tag', [ 'label' => __( 'Title HTML Tag', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', ], 'default' => 'div', 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_toggle_style', [ 'label' => __( 'Toggle', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'border_width', [ 'label' => __( 'Border Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-title' => 'border-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-toggle .elementor-tab-content' => 'border-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'border_color', [ 'label' => __( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-content' => 'border-bottom-color: {{VALUE}};', '{{WRAPPER}} .elementor-toggle .elementor-tab-title' => 'border-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'space_between', [ 'label' => __( 'Space Between', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-toggle-item:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'selector' => '{{WRAPPER}} .elementor-toggle .elementor-toggle-item', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_toggle_style_title', [ 'label' => __( 'Title', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_background', [ 'label' => __( 'Background', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-title' => 'background-color: {{VALUE}};', ], ] ); // The title selector specificity is to override Theme Style $this->add_control( 'title_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-toggle-title, {{WRAPPER}} .elementor-toggle-icon' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_control( 'tab_active_color', [ 'label' => __( 'Active Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-title.elementor-active a, {{WRAPPER}} .elementor-tab-title.elementor-active .elementor-toggle-icon' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_4, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .elementor-toggle .elementor-toggle-title', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, ] ); $this->add_responsive_control( 'title_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_toggle_style_icon', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->add_control( 'icon_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Start', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'right' => [ 'title' => __( 'End', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => is_rtl() ? 'right' : 'left', 'toggle' => false, ] ); $this->add_control( 'icon_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-title .elementor-toggle-icon i:before' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-toggle .elementor-tab-title .elementor-toggle-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_active_color', [ 'label' => __( 'Active Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-title.elementor-active .elementor-toggle-icon i:before' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-toggle .elementor-tab-title.elementor-active .elementor-toggle-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-toggle-icon.elementor-toggle-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-toggle .elementor-toggle-icon.elementor-toggle-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_toggle_style_content', [ 'label' => __( 'Content', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'content_background_color', [ 'label' => __( 'Background', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-content' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'content_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-content' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .elementor-toggle .elementor-tab-content', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->add_responsive_control( 'content_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-toggle .elementor-tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } /** * Render toggle widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $id_int = substr( $this->get_id_int(), 0, 3 ); $migrated = isset( $settings['__fa4_migrated']['selected_icon'] ); if ( ! isset( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) { // @todo: remove when deprecated // added as bc in 2.6 // add old default $settings['icon'] = 'fa fa-caret' . ( is_rtl() ? '-left' : '-right' ); $settings['icon_active'] = 'fa fa-caret-up'; $settings['icon_align'] = $this->get_settings( 'icon_align' ); } $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); $has_icon = ( ! $is_new || ! empty( $settings['selected_icon']['value'] ) ); ?>
$item ) : $tab_count = $index + 1; $tab_title_setting_key = $this->get_repeater_setting_key( 'tab_title', 'tabs', $index ); $tab_content_setting_key = $this->get_repeater_setting_key( 'tab_content', 'tabs', $index ); $this->add_render_attribute( $tab_title_setting_key, [ 'id' => 'elementor-tab-title-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-title' ], 'data-tab' => $tab_count, 'role' => 'tab', 'aria-controls' => 'elementor-tab-content-' . $id_int . $tab_count, ] ); $this->add_render_attribute( $tab_content_setting_key, [ 'id' => 'elementor-tab-content-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-content', 'elementor-clearfix' ], 'data-tab' => $tab_count, 'role' => 'tabpanel', 'aria-labelledby' => 'elementor-tab-title-' . $id_int . $tab_count, ] ); $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); ?>
< get_render_attribute_string( $tab_title_setting_key ); ?>> >
get_render_attribute_string( $tab_content_setting_key ); ?>>parse_text_editor( $item['tab_content'] ); ?>
<# if ( settings.tabs ) { var tabindex = view.getIDInt().toString().substr( 0, 3 ), iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, {}, 'i' , 'object' ), iconActiveHTML = elementor.helpers.renderIcon( view, settings.selected_active_icon, {}, 'i' , 'object' ), migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ); _.each( settings.tabs, function( item, index ) { var tabCount = index + 1, tabTitleKey = view.getRepeaterSettingKey( 'tab_title', 'tabs', index ), tabContentKey = view.getRepeaterSettingKey( 'tab_content', 'tabs', index ); view.addRenderAttribute( tabTitleKey, { 'id': 'elementor-tab-title-' + tabindex + tabCount, 'class': [ 'elementor-tab-title' ], 'data-tab': tabCount, 'role': 'tab', 'aria-controls': 'elementor-tab-content-' + tabindex + tabCount } ); view.addRenderAttribute( tabContentKey, { 'id': 'elementor-tab-content-' + tabindex + tabCount, 'class': [ 'elementor-tab-content', 'elementor-clearfix' ], 'data-tab': tabCount, 'role': 'tabpanel', 'aria-labelledby': 'elementor-tab-title-' + tabindex + tabCount } ); view.addInlineEditingAttributes( tabContentKey, 'advanced' ); #>
<{{{ settings.title_html_tag }}} {{{ view.getRenderAttributeString( tabTitleKey ) }}}> <# if ( settings.icon || settings.selected_icon ) { #> <# } #> {{{ item.tab_title }}}
{{{ item.tab_content }}}
<# } ); } #>
start_controls_section( 'section_alert', [ 'label' => __( 'Alert', 'elementor' ), ] ); $this->add_control( 'alert_type', [ 'label' => __( 'Type', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'info', 'options' => [ 'info' => __( 'Info', 'elementor' ), 'success' => __( 'Success', 'elementor' ), 'warning' => __( 'Warning', 'elementor' ), 'danger' => __( 'Danger', 'elementor' ), ], 'style_transfer' => true, ] ); $this->add_control( 'alert_title', [ 'label' => __( 'Title & Description', 'elementor' ), 'type' => Controls_Manager::TEXT, 'placeholder' => __( 'Enter your title', 'elementor' ), 'default' => __( 'This is an Alert', 'elementor' ), 'label_block' => true, 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'alert_description', [ 'label' => __( 'Content', 'elementor' ), 'type' => Controls_Manager::TEXTAREA, 'placeholder' => __( 'Enter your description', 'elementor' ), 'default' => __( 'I am a description. Click the edit button to change this text.', 'elementor' ), 'separator' => 'none', 'show_label' => false, 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'show_dismiss', [ 'label' => __( 'Dismiss Button', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'show', 'options' => [ 'show' => __( 'Show', 'elementor' ), 'hide' => __( 'Hide', 'elementor' ), ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_type', [ 'label' => __( 'Alert', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'background', [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-alert' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'border_color', [ 'label' => __( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-alert' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'border_left-width', [ 'label' => __( 'Left Border Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-alert' => 'border-left-width: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title', [ 'label' => __( 'Title', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-alert-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'alert_title', 'selector' => '{{WRAPPER}} .elementor-alert-title', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_description', [ 'label' => __( 'Description', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'description_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-alert-description' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'alert_description', 'selector' => '{{WRAPPER}} .elementor-alert-description', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); } /** * Render alert widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); if ( Utils::is_empty( $settings['alert_title'] ) ) { return; } if ( ! empty( $settings['alert_type'] ) ) { $this->add_render_attribute( 'wrapper', 'class', 'elementor-alert elementor-alert-' . $settings['alert_type'] ); } $this->add_render_attribute( 'wrapper', 'role', 'alert' ); $this->add_render_attribute( 'alert_title', 'class', 'elementor-alert-title' ); $this->add_inline_editing_attributes( 'alert_title', 'none' ); ?>
get_render_attribute_string( 'wrapper' ); ?>> get_render_attribute_string( 'alert_title' ); ?>> add_render_attribute( 'alert_description', 'class', 'elementor-alert-description' ); $this->add_inline_editing_attributes( 'alert_description' ); ?> get_render_attribute_string( 'alert_description' ); ?>>
<# if ( settings.alert_title ) { view.addRenderAttribute( { alert_title: { class: 'elementor-alert-title' }, alert_description: { class: 'elementor-alert-description' } } ); view.addInlineEditingAttributes( 'alert_title', 'none' ); view.addInlineEditingAttributes( 'alert_description' ); #> <# } #> start_controls_section( 'section_counter', [ 'label' => __( 'Counter', 'elementor' ), ] ); $this->add_control( 'starting_number', [ 'label' => __( 'Starting Number', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'default' => 0, 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'ending_number', [ 'label' => __( 'Ending Number', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'default' => 100, 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'prefix', [ 'label' => __( 'Number Prefix', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => '', 'placeholder' => 1, ] ); $this->add_control( 'suffix', [ 'label' => __( 'Number Suffix', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => '', 'placeholder' => __( 'Plus', 'elementor' ), ] ); $this->add_control( 'duration', [ 'label' => __( 'Animation Duration', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'default' => 2000, 'min' => 100, 'step' => 100, ] ); $this->add_control( 'thousand_separator', [ 'label' => __( 'Thousand Separator', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'label_on' => __( 'Show', 'elementor' ), 'label_off' => __( 'Hide', 'elementor' ), ] ); $this->add_control( 'thousand_separator_char', [ 'label' => __( 'Separator', 'elementor' ), 'type' => Controls_Manager::SELECT, 'condition' => [ 'thousand_separator' => 'yes', ], 'options' => [ '' => 'Default', '.' => 'Dot', ' ' => 'Space', ], ] ); $this->add_control( 'title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'default' => __( 'Cool Number', 'elementor' ), 'placeholder' => __( 'Cool Number', 'elementor' ), ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_number', [ 'label' => __( 'Number', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'number_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .elementor-counter-number-wrapper' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography_number', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .elementor-counter-number-wrapper', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title', [ 'label' => __( 'Title', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .elementor-counter-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography_title', 'scheme' => Schemes\Typography::TYPOGRAPHY_2, 'selector' => '{{WRAPPER}} .elementor-counter-title', ] ); $this->end_controls_section(); } /** * Render counter widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() { ?> <# view.addRenderAttribute( 'counter-title', { 'class': 'elementor-counter-title' } ); view.addInlineEditingAttributes( 'counter-title' ); #>
{{{ settings.prefix }}} {{{ settings.starting_number }}} {{{ settings.suffix }}}
<# if ( settings.title ) { #>
{{{ settings.title }}}
<# } #>
get_settings_for_display(); $this->add_render_attribute( 'counter', [ 'class' => 'elementor-counter-number', 'data-duration' => $settings['duration'], 'data-to-value' => $settings['ending_number'], 'data-from-value' => $settings['starting_number'], ] ); if ( ! empty( $settings['thousand_separator'] ) ) { $delimiter = empty( $settings['thousand_separator_char'] ) ? ',' : $settings['thousand_separator_char']; $this->add_render_attribute( 'counter', 'data-delimiter', $delimiter ); } $this->add_render_attribute( 'counter-title', 'class', 'elementor-counter-title' ); $this->add_inline_editing_attributes( 'counter-title' ); ?>
get_render_attribute_string( 'counter' ); ?>>
get_render_attribute_string( 'counter-title' ); ?>>
start_controls_section( 'section_rating', [ 'label' => __( 'Rating', 'elementor' ), ] ); $this->add_control( 'rating_scale', [ 'label' => __( 'Rating Scale', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '5' => '0-5', '10' => '0-10', ], 'default' => '5', ] ); $this->add_control( 'rating', [ 'label' => __( 'Rating', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'min' => 0, 'max' => 10, 'step' => 0.1, 'default' => 5, 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'star_style', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'star_fontawesome' => 'Font Awesome', 'star_unicode' => 'Unicode', ], 'default' => 'star_fontawesome', 'render_type' => 'template', 'prefix_class' => 'elementor--star-style-', 'separator' => 'before', ] ); $this->add_control( 'unmarked_star_style', [ 'label' => __( 'Unmarked Style', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'solid' => [ 'title' => __( 'Solid', 'elementor' ), 'icon' => 'eicon-star', ], 'outline' => [ 'title' => __( 'Outline', 'elementor' ), 'icon' => 'eicon-star-o', ], ], 'default' => 'solid', ] ); $this->add_control( 'title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::TEXT, 'separator' => 'before', 'dynamic' => [ 'active' => true, ], ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'prefix_class' => 'elementor-star-rating%s--align-', 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title_style', [ 'label' => __( 'Title', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'title!' => '', ], ] ); $this->add_control( 'title_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], 'selectors' => [ '{{WRAPPER}} .elementor-star-rating__title' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .elementor-star-rating__title', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->add_responsive_control( 'title_gap', [ 'label' => __( 'Gap', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}}:not(.elementor-star-rating--align-justify) .elementor-star-rating__title' => 'margin-right: {{SIZE}}{{UNIT}}', 'body.rtl {{WRAPPER}}:not(.elementor-star-rating--align-justify) .elementor-star-rating__title' => 'margin-left: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_stars_style', [ 'label' => __( 'Stars', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-star-rating' => 'font-size: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'icon_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}} .elementor-star-rating i:not(:last-of-type)' => 'margin-right: {{SIZE}}{{UNIT}}', 'body.rtl {{WRAPPER}} .elementor-star-rating i:not(:last-of-type)' => 'margin-left: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'stars_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-star-rating i:before' => 'color: {{VALUE}}', ], 'separator' => 'before', ] ); $this->add_control( 'stars_unmarked_color', [ 'label' => __( 'Unmarked Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-star-rating i' => 'color: {{VALUE}}', ], ] ); $this->end_controls_section(); } /** * @since 2.3.0 * @access protected */ protected function get_rating() { $settings = $this->get_settings_for_display(); $rating_scale = (int) $settings['rating_scale']; $rating = (float) $settings['rating'] > $rating_scale ? $rating_scale : $settings['rating']; return [ $rating, $rating_scale ]; } /** * Print the actual stars and calculate their filling. * * Rating type is float to allow stars-count to be a fraction. * Floored-rating type is int, to represent the rounded-down stars count. * In the `for` loop, the index type is float to allow comparing with the rating value. * * @since 2.3.0 * @access protected */ protected function render_stars( $icon ) { $rating_data = $this->get_rating(); $rating = (float) $rating_data[0]; $floored_rating = floor( $rating ); $stars_html = ''; for ( $stars = 1.0; $stars <= $rating_data[1]; $stars++ ) { if ( $stars <= $floored_rating ) { $stars_html .= '' . $icon . ''; } elseif ( $floored_rating + 1 === $stars && $rating !== $floored_rating ) { $stars_html .= '' . $icon . ''; } else { $stars_html .= '' . $icon . ''; } } return $stars_html; } /** * @since 2.3.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $rating_data = $this->get_rating(); $textual_rating = $rating_data[0] . '/' . $rating_data[1]; $icon = ''; if ( 'star_fontawesome' === $settings['star_style'] ) { if ( 'outline' === $settings['unmarked_star_style'] ) { $icon = ''; } } elseif ( 'star_unicode' === $settings['star_style'] ) { $icon = '★'; if ( 'outline' === $settings['unmarked_star_style'] ) { $icon = '☆'; } } $this->add_render_attribute( 'icon_wrapper', [ 'class' => 'elementor-star-rating', 'title' => $textual_rating, 'itemtype' => 'http://schema.org/Rating', 'itemscope' => '', 'itemprop' => 'reviewRating', ] ); $schema_rating = '' . $textual_rating . ''; $stars_element = '
get_render_attribute_string( 'icon_wrapper' ) . '>' . $this->render_stars( $icon ) . ' ' . $schema_rating . '
'; ?>
<# var getRating = function() { var ratingScale = parseInt( settings.rating_scale, 10 ), rating = settings.rating > ratingScale ? ratingScale : settings.rating; return [ rating, ratingScale ]; }, ratingData = getRating(), rating = ratingData[0], textualRating = ratingData[0] + '/' + ratingData[1], renderStars = function( icon ) { var starsHtml = '', flooredRating = Math.floor( rating ); for ( var stars = 1; stars <= ratingData[1]; stars++ ) { if ( stars <= flooredRating ) { starsHtml += '' + icon + ''; } else if ( flooredRating + 1 === stars && rating !== flooredRating ) { starsHtml += '' + icon + ''; } else { starsHtml += '' + icon + ''; } } return starsHtml; }, icon = ''; if ( 'star_fontawesome' === settings.star_style ) { if ( 'outline' === settings.unmarked_star_style ) { icon = ''; } } else if ( 'star_unicode' === settings.star_style ) { icon = '★'; if ( 'outline' === settings.unmarked_star_style ) { icon = '☆'; } } view.addRenderAttribute( 'iconWrapper', 'class', 'elementor-star-rating' ); view.addRenderAttribute( 'iconWrapper', 'itemtype', 'http://schema.org/Rating' ); view.addRenderAttribute( 'iconWrapper', 'title', textualRating ); view.addRenderAttribute( 'iconWrapper', 'itemscope', '' ); view.addRenderAttribute( 'iconWrapper', 'itemprop', 'reviewRating' ); var stars = renderStars( icon ); #>
<# if ( ! _.isEmpty( settings.title ) ) { #>
{{ settings.title }}
<# } #>
{{{ stars }}} {{ textualRating }}
start_controls_section( 'section_gallery', [ 'label' => __( 'Image Gallery', 'elementor' ), ] ); $this->add_control( 'wp_gallery', [ 'label' => __( 'Add Images', 'elementor' ), 'type' => Controls_Manager::GALLERY, 'show_label' => false, 'dynamic' => [ 'active' => true, ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'thumbnail', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. 'exclude' => [ 'custom' ], 'separator' => 'none', ] ); $gallery_columns = range( 1, 10 ); $gallery_columns = array_combine( $gallery_columns, $gallery_columns ); $this->add_control( 'gallery_columns', [ 'label' => __( 'Columns', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 4, 'options' => $gallery_columns, ] ); $this->add_control( 'gallery_link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'file', 'options' => [ 'file' => __( 'Media File', 'elementor' ), 'attachment' => __( 'Attachment Page', 'elementor' ), 'none' => __( 'None', 'elementor' ), ], ] ); $this->add_control( 'open_lightbox', [ 'label' => __( 'Lightbox', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => __( 'Default', 'elementor' ), 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], 'condition' => [ 'gallery_link' => 'file', ], ] ); $this->add_control( 'gallery_rand', [ 'label' => __( 'Order By', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Default', 'elementor' ), 'rand' => __( 'Random', 'elementor' ), ], 'default' => '', ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_gallery_images', [ 'label' => __( 'Images', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'image_spacing', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Default', 'elementor' ), 'custom' => __( 'Custom', 'elementor' ), ], 'prefix_class' => 'gallery-spacing-', 'default' => '', ] ); $columns_margin = is_rtl() ? '0 0 -{{SIZE}}{{UNIT}} -{{SIZE}}{{UNIT}};' : '0 -{{SIZE}}{{UNIT}} -{{SIZE}}{{UNIT}} 0;'; $columns_padding = is_rtl() ? '0 0 {{SIZE}}{{UNIT}} {{SIZE}}{{UNIT}};' : '0 {{SIZE}}{{UNIT}} {{SIZE}}{{UNIT}} 0;'; $this->add_control( 'image_spacing_custom', [ 'label' => __( 'Image Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'show_label' => false, 'range' => [ 'px' => [ 'max' => 100, ], ], 'default' => [ 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .gallery-item' => 'padding:' . $columns_padding, '{{WRAPPER}} .gallery' => 'margin: ' . $columns_margin, ], 'condition' => [ 'image_spacing' => 'custom', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border', 'selector' => '{{WRAPPER}} .gallery-item img', 'separator' => 'before', ] ); $this->add_control( 'image_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .gallery-item img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_caption', [ 'label' => __( 'Caption', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'gallery_display_caption', [ 'label' => __( 'Display', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'Show', 'elementor' ), 'none' => __( 'Hide', 'elementor' ), ], 'selectors' => [ '{{WRAPPER}} .gallery-item .gallery-caption' => 'display: {{VALUE}};', ], ] ); $this->add_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .gallery-item .gallery-caption' => 'text-align: {{VALUE}};', ], 'condition' => [ 'gallery_display_caption' => '', ], ] ); $this->add_control( 'text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .gallery-item .gallery-caption' => 'color: {{VALUE}};', ], 'condition' => [ 'gallery_display_caption' => '', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_4, 'selector' => '{{WRAPPER}} .gallery-item .gallery-caption', 'condition' => [ 'gallery_display_caption' => '', ], ] ); $this->end_controls_section(); } /** * Render image gallery widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); if ( ! $settings['wp_gallery'] ) { return; } $ids = wp_list_pluck( $settings['wp_gallery'], 'id' ); $this->add_render_attribute( 'shortcode', 'ids', implode( ',', $ids ) ); $this->add_render_attribute( 'shortcode', 'size', $settings['thumbnail_size'] ); if ( $settings['gallery_columns'] ) { $this->add_render_attribute( 'shortcode', 'columns', $settings['gallery_columns'] ); } if ( $settings['gallery_link'] ) { $this->add_render_attribute( 'shortcode', 'link', $settings['gallery_link'] ); } if ( ! empty( $settings['gallery_rand'] ) ) { $this->add_render_attribute( 'shortcode', 'orderby', $settings['gallery_rand'] ); } ?> __( 'Extra Small', 'elementor' ), 'sm' => __( 'Small', 'elementor' ), 'md' => __( 'Medium', 'elementor' ), 'lg' => __( 'Large', 'elementor' ), 'xl' => __( 'Extra Large', 'elementor' ), ]; } /** * Register button widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function _register_controls() { $this->start_controls_section( 'section_button', [ 'label' => __( 'Button', 'elementor' ), ] ); $this->add_control( 'button_type', [ 'label' => __( 'Type', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'Default', 'elementor' ), 'info' => __( 'Info', 'elementor' ), 'success' => __( 'Success', 'elementor' ), 'warning' => __( 'Warning', 'elementor' ), 'danger' => __( 'Danger', 'elementor' ), ], 'prefix_class' => 'elementor-button-', ] ); $this->add_control( 'text', [ 'label' => __( 'Text', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => __( 'Click here', 'elementor' ), 'placeholder' => __( 'Click here', 'elementor' ), ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), 'default' => [ 'url' => '#', ], ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'prefix_class' => 'elementor%s-align-', 'default' => '', ] ); $this->add_control( 'size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'sm', 'options' => self::get_button_sizes(), 'style_transfer' => true, ] ); $this->add_control( 'selected_icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon', ] ); $this->add_control( 'icon_align', [ 'label' => __( 'Icon Position', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'left', 'options' => [ 'left' => __( 'Before', 'elementor' ), 'right' => __( 'After', 'elementor' ), ], 'condition' => [ 'selected_icon[value]!' => '', ], ] ); $this->add_control( 'icon_indent', [ 'label' => __( 'Icon Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-button .elementor-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-button .elementor-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->add_control( 'button_css_id', [ 'label' => __( 'Button ID', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => '', 'title' => __( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ), 'description' => __( 'Please make sure the ID is unique and not used elsewhere on the page this form is displayed. This field allows A-z 0-9 & underscore chars without spaces.', 'elementor' ), 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', [ 'label' => __( 'Button', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_4, 'selector' => '{{WRAPPER}} .elementor-button', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow', 'selector' => '{{WRAPPER}} .elementor-button', ] ); $this->start_controls_tabs( 'tabs_button_style' ); $this->start_controls_tab( 'tab_button_normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_control( 'button_text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'fill: {{VALUE}}; color: {{VALUE}};', ], ] ); $this->add_control( 'background_color', [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_4, ], 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'background-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_button_hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_control( 'hover_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-button:hover, {{WRAPPER}} .elementor-button:focus' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-button:hover svg, {{WRAPPER}} .elementor-button:focus svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'button_background_hover_color', [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-button:hover, {{WRAPPER}} .elementor-button:focus' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_hover_border_color', [ 'label' => __( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'border_border!' => '', ], 'selectors' => [ '{{WRAPPER}} .elementor-button:hover, {{WRAPPER}} .elementor-button:focus' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'hover_animation', [ 'label' => __( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'border', 'selector' => '{{WRAPPER}} .elementor-button', 'separator' => 'before', ] ); $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_box_shadow', 'selector' => '{{WRAPPER}} .elementor-button', ] ); $this->add_responsive_control( 'text_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); } /** * Render button widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $this->add_render_attribute( 'wrapper', 'class', 'elementor-button-wrapper' ); if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'button', $settings['link'] ); $this->add_render_attribute( 'button', 'class', 'elementor-button-link' ); } $this->add_render_attribute( 'button', 'class', 'elementor-button' ); $this->add_render_attribute( 'button', 'role', 'button' ); if ( ! empty( $settings['button_css_id'] ) ) { $this->add_render_attribute( 'button', 'id', $settings['button_css_id'] ); } if ( ! empty( $settings['size'] ) ) { $this->add_render_attribute( 'button', 'class', 'elementor-size-' . $settings['size'] ); } if ( $settings['hover_animation'] ) { $this->add_render_attribute( 'button', 'class', 'elementor-animation-' . $settings['hover_animation'] ); } ?>
get_render_attribute_string( 'wrapper' ); ?>> get_render_attribute_string( 'button' ); ?>> render_text(); ?>
<# view.addRenderAttribute( 'text', 'class', 'elementor-button-text' ); view.addInlineEditingAttributes( 'text', 'none' ); var iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ), migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ); #> get_settings_for_display(); $migrated = isset( $settings['__fa4_migrated']['selected_icon'] ); $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); if ( ! $is_new && empty( $settings['icon_align'] ) ) { // @todo: remove when deprecated // added as bc in 2.6 //old default $settings['icon_align'] = $this->get_settings( 'icon_align' ); } $this->add_render_attribute( [ 'content-wrapper' => [ 'class' => 'elementor-button-content-wrapper', ], 'icon-align' => [ 'class' => [ 'elementor-button-icon', 'elementor-align-icon-' . $settings['icon_align'], ], ], 'text' => [ 'class' => 'elementor-button-text', ], ] ); $this->add_inline_editing_attributes( 'text', 'none' ); ?> get_render_attribute_string( 'content-wrapper' ); ?>> get_render_attribute_string( 'icon-align' ); ?>> 'true' ] ); else : ?> get_render_attribute_string( 'text' ); ?>> start_controls_section( 'section_icon', [ 'label' => __( 'Icon', 'elementor' ), ] ); $this->add_control( 'selected_icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon', 'default' => [ 'value' => 'fas fa-star', 'library' => 'fa-solid', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'default' => __( 'Default', 'elementor' ), 'stacked' => __( 'Stacked', 'elementor' ), 'framed' => __( 'Framed', 'elementor' ), ], 'default' => 'default', 'prefix_class' => 'elementor-view-', ] ); $this->add_control( 'shape', [ 'label' => __( 'Shape', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'circle' => __( 'Circle', 'elementor' ), 'square' => __( 'Square', 'elementor' ), ], 'default' => 'circle', 'condition' => [ 'view!' => 'default', ], 'prefix_class' => 'elementor-shape-', ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .elementor-icon-wrapper' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_icon', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( 'icon_colors' ); $this->start_controls_tab( 'icon_colors_normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_control( 'primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon' => 'color: {{VALUE}}; border-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon svg' => 'fill: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_control( 'secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'view!' => 'default', ], 'selectors' => [ '{{WRAPPER}}.elementor-view-framed .elementor-icon' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'icon_colors_hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_control( 'hover_primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover, {{WRAPPER}}.elementor-view-default .elementor-icon:hover' => 'color: {{VALUE}}; border-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover, {{WRAPPER}}.elementor-view-default .elementor-icon:hover svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'hover_secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'view!' => 'default', ], 'selectors' => [ '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover' => 'color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'hover_animation', [ 'label' => __( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 6, 'max' => 300, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'font-size: {{SIZE}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->add_control( 'icon_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'padding: {{SIZE}}{{UNIT}};', ], 'range' => [ 'em' => [ 'min' => 0, 'max' => 5, ], ], 'condition' => [ 'view!' => 'default', ], ] ); $this->add_responsive_control( 'rotate', [ 'label' => __( 'Rotate', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'deg' ], 'default' => [ 'size' => 0, 'unit' => 'deg', ], 'tablet_default' => [ 'unit' => 'deg', ], 'mobile_default' => [ 'unit' => 'deg', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon i, {{WRAPPER}} .elementor-icon svg' => 'transform: rotate({{SIZE}}{{UNIT}});', ], ] ); $this->add_control( 'border_width', [ 'label' => __( 'Border Width', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'view' => 'framed', ], ] ); $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'view!' => 'default', ], ] ); $this->end_controls_section(); } /** * Render icon widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $this->add_render_attribute( 'wrapper', 'class', 'elementor-icon-wrapper' ); $this->add_render_attribute( 'icon-wrapper', 'class', 'elementor-icon' ); if ( ! empty( $settings['hover_animation'] ) ) { $this->add_render_attribute( 'icon-wrapper', 'class', 'elementor-animation-' . $settings['hover_animation'] ); } $icon_tag = 'div'; if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'icon-wrapper', $settings['link'] ); $icon_tag = 'a'; } if ( empty( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) { // add old default $settings['icon'] = 'fa fa-star'; } if ( ! empty( $settings['icon'] ) ) { $this->add_render_attribute( 'icon', 'class', $settings['icon'] ); $this->add_render_attribute( 'icon', 'aria-hidden', 'true' ); } $migrated = isset( $settings['__fa4_migrated']['selected_icon'] ); $is_new = empty( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); ?>
get_render_attribute_string( 'wrapper' ); ?>> <get_render_attribute_string( 'icon-wrapper' ); ?>> 'true' ] ); else : ?> get_render_attribute_string( 'icon' ); ?>> >
<# var link = settings.link.url ? 'href="' + settings.link.url + '"' : '', iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ), migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ), iconTag = link ? 'a' : 'div'; #>
<{{{ iconTag }}} class="elementor-icon elementor-animation-{{ settings.hover_animation }}" {{{ link }}}> <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #> {{{ iconHTML.value }}} <# } else { #> <# } #>
start_controls_section( 'section_icon', [ 'label' => __( 'Icon Box', 'elementor' ), ] ); $this->add_control( 'selected_icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon', 'default' => [ 'value' => 'fas fa-star', 'library' => 'fa-solid', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'default' => __( 'Default', 'elementor' ), 'stacked' => __( 'Stacked', 'elementor' ), 'framed' => __( 'Framed', 'elementor' ), ], 'default' => 'default', 'prefix_class' => 'elementor-view-', ] ); $this->add_control( 'shape', [ 'label' => __( 'Shape', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'circle' => __( 'Circle', 'elementor' ), 'square' => __( 'Square', 'elementor' ), ], 'default' => 'circle', 'condition' => [ 'view!' => 'default', 'selected_icon[value]!' => '', ], 'prefix_class' => 'elementor-shape-', ] ); $this->add_control( 'title_text', [ 'label' => __( 'Title & Description', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => __( 'This is the heading', 'elementor' ), 'placeholder' => __( 'Enter your title', 'elementor' ), 'label_block' => true, ] ); $this->add_control( 'description_text', [ 'label' => '', 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), 'placeholder' => __( 'Enter your description', 'elementor' ), 'rows' => 10, 'separator' => 'none', 'show_label' => false, ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), 'separator' => 'before', ] ); $this->add_control( 'position', [ 'label' => __( 'Icon Position', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'top', 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'top' => [ 'title' => __( 'Top', 'elementor' ), 'icon' => 'eicon-v-align-top', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'prefix_class' => 'elementor-position-', 'toggle' => false, 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'name' => 'selected_icon[value]', 'operator' => '!=', 'value' => '', ], ], ], ] ); $this->add_control( 'title_size', [ 'label' => __( 'Title HTML Tag', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ], 'default' => 'h3', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_icon', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'name' => 'selected_icon[value]', 'operator' => '!=', 'value' => '', ], ], ], ] ); $this->start_controls_tabs( 'icon_colors' ); $this->start_controls_tab( 'icon_colors_normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_control( 'primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], 'default' => '', 'selectors' => [ '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon' => 'fill: {{VALUE}}; color: {{VALUE}}; border-color: {{VALUE}};', ], ] ); $this->add_control( 'secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'view!' => 'default', ], 'selectors' => [ '{{WRAPPER}}.elementor-view-framed .elementor-icon' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'fill: {{VALUE}}; color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'icon_colors_hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_control( 'hover_primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover, {{WRAPPER}}.elementor-view-default .elementor-icon:hover' => 'fill: {{VALUE}}; color: {{VALUE}}; border-color: {{VALUE}};', ], ] ); $this->add_control( 'hover_secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'view!' => 'default', ], 'selectors' => [ '{{WRAPPER}}.elementor-view-framed .elementor-icon:hover' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon:hover' => 'fill: {{VALUE}}; color: {{VALUE}};', ], ] ); $this->add_control( 'hover_animation', [ 'label' => __( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'icon_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 15, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}}.elementor-position-right .elementor-icon-box-icon' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}}.elementor-position-left .elementor-icon-box-icon' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}}.elementor-position-top .elementor-icon-box-icon' => 'margin-bottom: {{SIZE}}{{UNIT}};', '(mobile){{WRAPPER}} .elementor-icon-box-icon' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 6, 'max' => 300, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'padding: {{SIZE}}{{UNIT}};', ], 'range' => [ 'em' => [ 'min' => 0, 'max' => 5, ], ], 'condition' => [ 'view!' => 'default', ], ] ); $this->add_control( 'rotate', [ 'label' => __( 'Rotate', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 0, 'unit' => 'deg', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon i' => 'transform: rotate({{SIZE}}{{UNIT}});', ], ] ); $this->add_control( 'border_width', [ 'label' => __( 'Border Width', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'view' => 'framed', ], ] ); $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'view!' => 'default', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_content', [ 'label' => __( 'Content', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'text_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-box-wrapper' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'content_vertical_alignment', [ 'label' => __( 'Vertical Alignment', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'top' => __( 'Top', 'elementor' ), 'middle' => __( 'Middle', 'elementor' ), 'bottom' => __( 'Bottom', 'elementor' ), ], 'default' => 'top', 'prefix_class' => 'elementor-vertical-align-', ] ); $this->add_control( 'heading_title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'title_bottom_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-box-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'title_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-title' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-title', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, ] ); $this->add_control( 'heading_description', [ 'label' => __( 'Description', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'description_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'description_typography', 'selector' => '{{WRAPPER}} .elementor-icon-box-content .elementor-icon-box-description', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); } /** * Render icon box widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $this->add_render_attribute( 'icon', 'class', [ 'elementor-icon', 'elementor-animation-' . $settings['hover_animation'] ] ); $icon_tag = 'span'; if ( ! isset( $settings['icon'] ) && ! Icons_Manager::is_migration_allowed() ) { // add old default $settings['icon'] = 'fa fa-star'; } $has_icon = ! empty( $settings['icon'] ); if ( ! empty( $settings['link']['url'] ) ) { $icon_tag = 'a'; $this->add_link_attributes( 'link', $settings['link'] ); } if ( $has_icon ) { $this->add_render_attribute( 'i', 'class', $settings['icon'] ); $this->add_render_attribute( 'i', 'aria-hidden', 'true' ); } $icon_attributes = $this->get_render_attribute_string( 'icon' ); $link_attributes = $this->get_render_attribute_string( 'link' ); $this->add_render_attribute( 'description_text', 'class', 'elementor-icon-box-description' ); $this->add_inline_editing_attributes( 'title_text', 'none' ); $this->add_inline_editing_attributes( 'description_text' ); if ( ! $has_icon && ! empty( $settings['selected_icon']['value'] ) ) { $has_icon = true; } $migrated = isset( $settings['__fa4_migrated']['selected_icon'] ); $is_new = ! isset( $settings['icon'] ) && Icons_Manager::is_migration_allowed(); ?>
<> 'true' ] ); } elseif ( ! empty( $settings['icon'] ) ) { ?>get_render_attribute_string( 'i' ); ?>> >
< class="elementor-icon-box-title"> <get_render_attribute_string( 'title_text' ); ?>>> >

get_render_attribute_string( 'description_text' ); ?>>

<# var link = settings.link.url ? 'href="' + settings.link.url + '"' : '', iconTag = link ? 'a' : 'span', iconHTML = elementor.helpers.renderIcon( view, settings.selected_icon, { 'aria-hidden': true }, 'i' , 'object' ), migrated = elementor.helpers.isIconMigrated( settings, 'selected_icon' ); view.addRenderAttribute( 'description_text', 'class', 'elementor-icon-box-description' ); view.addInlineEditingAttributes( 'title_text', 'none' ); view.addInlineEditingAttributes( 'description_text' ); #>
<# if ( settings.icon || settings.selected_icon ) { #>
<{{{ iconTag + ' ' + link }}} class="elementor-icon elementor-animation-{{ settings.hover_animation }}"> <# if ( iconHTML && iconHTML.rendered && ( ! settings.icon || migrated ) ) { #> {{{ iconHTML.value }}} <# } else { #> <# } #>
<# } #>
<{{{ settings.title_size }}} class="elementor-icon-box-title"> <{{{ iconTag + ' ' + link }}} {{{ view.getRenderAttributeString( 'title_text' ) }}}>{{{ settings.title_text }}} <# if ( settings.description_text ) { #>

{{{ settings.description_text }}}

<# } #>
start_controls_section( 'section_title', [ 'label' => __( 'Title', 'elementor' ), ] ); $this->add_control( 'title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your title', 'elementor' ), 'default' => __( 'Add Your Heading Text Here', 'elementor' ), ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => '', ], 'separator' => 'before', ] ); $this->add_control( 'size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => __( 'Default', 'elementor' ), 'small' => __( 'Small', 'elementor' ), 'medium' => __( 'Medium', 'elementor' ), 'large' => __( 'Large', 'elementor' ), 'xl' => __( 'XL', 'elementor' ), 'xxl' => __( 'XXL', 'elementor' ), ], ] ); $this->add_control( 'header_size', [ 'label' => __( 'HTML Tag', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ], 'default' => 'h2', ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title_style', [ 'label' => __( 'Title', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .elementor-heading-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .elementor-heading-title', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow', 'selector' => '{{WRAPPER}} .elementor-heading-title', ] ); $this->add_control( 'blend_mode', [ 'label' => __( 'Blend Mode', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Normal', 'elementor' ), 'multiply' => 'Multiply', 'screen' => 'Screen', 'overlay' => 'Overlay', 'darken' => 'Darken', 'lighten' => 'Lighten', 'color-dodge' => 'Color Dodge', 'saturation' => 'Saturation', 'color' => 'Color', 'difference' => 'Difference', 'exclusion' => 'Exclusion', 'hue' => 'Hue', 'luminosity' => 'Luminosity', ], 'selectors' => [ '{{WRAPPER}} .elementor-heading-title' => 'mix-blend-mode: {{VALUE}}', ], 'separator' => 'none', ] ); $this->end_controls_section(); } /** * Render heading widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); if ( '' === $settings['title'] ) { return; } $this->add_render_attribute( 'title', 'class', 'elementor-heading-title' ); if ( ! empty( $settings['size'] ) ) { $this->add_render_attribute( 'title', 'class', 'elementor-size-' . $settings['size'] ); } $this->add_inline_editing_attributes( 'title' ); $title = $settings['title']; if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'url', $settings['link'] ); $title = sprintf( '%2$s', $this->get_render_attribute_string( 'url' ), $title ); } $title_html = sprintf( '<%1$s %2$s>%3$s', $settings['header_size'], $this->get_render_attribute_string( 'title' ), $title ); echo $title_html; } /** * Render heading widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() { ?> <# var title = settings.title; if ( '' !== settings.link.url ) { title = '' + title + ''; } view.addRenderAttribute( 'title', 'class', [ 'elementor-heading-title', 'elementor-size-' + settings.size ] ); view.addInlineEditingAttributes( 'title' ); var title_html = '<' + settings.header_size + ' ' + view.getRenderAttributeString( 'title' ) + '>' + title + ''; print( title_html ); #> $sidebar ) { $options[ $sidebar_id ] = $sidebar['name']; } } $default_key = array_keys( $options ); $default_key = array_shift( $default_key ); $this->start_controls_section( 'section_sidebar', [ 'label' => __( 'Sidebar', 'elementor' ), ] ); $this->add_control( 'sidebar', [ 'label' => __( 'Choose Sidebar', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => $default_key, 'options' => $options, ] ); $this->end_controls_section(); } /** * Render sidebar widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $sidebar = $this->get_settings_for_display( 'sidebar' ); if ( empty( $sidebar ) ) { return; } dynamic_sidebar( $sidebar ); } /** * Render sidebar widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() {} /** * Render sidebar widget as plain content. * * Override the default render behavior, don't render sidebar content. * * @since 1.0.0 * @access public */ public function render_plain_content() {} } PKYe\ '6''text-editor.phpnuW+Astart_controls_section( 'section_editor', [ 'label' => __( 'Text Editor', 'elementor' ), ] ); $this->add_control( 'editor', [ 'label' => '', 'type' => Controls_Manager::WYSIWYG, 'default' => '

' . __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ) . '

', ] ); $this->add_control( 'drop_cap', [ 'label' => __( 'Drop Cap', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Off', 'elementor' ), 'label_on' => __( 'On', 'elementor' ), 'prefix_class' => 'elementor-drop-cap-', 'frontend_available' => true, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', [ 'label' => __( 'Text Editor', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-text-editor' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}}' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $text_columns = range( 1, 10 ); $text_columns = array_combine( $text_columns, $text_columns ); $text_columns[''] = __( 'Default', 'elementor' ); $this->add_responsive_control( 'text_columns', [ 'label' => __( 'Columns', 'elementor' ), 'type' => Controls_Manager::SELECT, 'separator' => 'before', 'options' => $text_columns, 'selectors' => [ '{{WRAPPER}} .elementor-text-editor' => 'columns: {{VALUE}};', ], ] ); $this->add_responsive_control( 'column_gap', [ 'label' => __( 'Columns Gap', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'vw' ], 'range' => [ 'px' => [ 'max' => 100, ], '%' => [ 'max' => 10, 'step' => 0.1, ], 'vw' => [ 'max' => 10, 'step' => 0.1, ], 'em' => [ 'max' => 10, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-text-editor' => 'column-gap: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_drop_cap', [ 'label' => __( 'Drop Cap', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'drop_cap' => 'yes', ], ] ); $this->add_control( 'drop_cap_view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'default' => __( 'Default', 'elementor' ), 'stacked' => __( 'Stacked', 'elementor' ), 'framed' => __( 'Framed', 'elementor' ), ], 'default' => 'default', 'prefix_class' => 'elementor-drop-cap-view-', ] ); $this->add_control( 'drop_cap_primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}}.elementor-drop-cap-view-stacked .elementor-drop-cap' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-drop-cap-view-framed .elementor-drop-cap, {{WRAPPER}}.elementor-drop-cap-view-default .elementor-drop-cap' => 'color: {{VALUE}}; border-color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_control( 'drop_cap_secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}}.elementor-drop-cap-view-framed .elementor-drop-cap' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-drop-cap-view-stacked .elementor-drop-cap' => 'color: {{VALUE}};', ], 'condition' => [ 'drop_cap_view!' => 'default', ], ] ); $this->add_control( 'drop_cap_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 5, ], 'range' => [ 'px' => [ 'max' => 30, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-drop-cap' => 'padding: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'drop_cap_view!' => 'default', ], ] ); $this->add_control( 'drop_cap_space', [ 'label' => __( 'Space', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 10, ], 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}} .elementor-drop-cap' => 'margin-right: {{SIZE}}{{UNIT}};', 'body.rtl {{WRAPPER}} .elementor-drop-cap' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'drop_cap_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'default' => [ 'unit' => '%', ], 'range' => [ '%' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-drop-cap' => 'border-radius: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'drop_cap_border_width', [ 'label' => __( 'Border Width', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'selectors' => [ '{{WRAPPER}} .elementor-drop-cap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'drop_cap_view' => 'framed', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'drop_cap_typography', 'selector' => '{{WRAPPER}} .elementor-drop-cap-letter', 'exclude' => [ 'letter_spacing', ], ] ); $this->end_controls_section(); } /** * Render text editor widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $editor_content = $this->get_settings_for_display( 'editor' ); $editor_content = $this->parse_text_editor( $editor_content ); $this->add_render_attribute( 'editor', 'class', [ 'elementor-text-editor', 'elementor-clearfix' ] ); $this->add_inline_editing_attributes( 'editor', 'advanced' ); ?>
get_render_attribute_string( 'editor' ); ?>>
get_settings( 'editor' ); } /** * Render text editor widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() { ?> <# view.addRenderAttribute( 'editor', 'class', [ 'elementor-text-editor', 'elementor-clearfix' ] ); view.addInlineEditingAttributes( 'editor', 'advanced' ); #>
{{{ settings.editor }}}
start_controls_section( 'section_title', [ 'label' => __( 'Read More', 'elementor' ), ] ); $default_link_text = apply_filters( 'elementor/widgets/read_more/default_link_text', __( 'Continue reading', 'elementor' ) ); $this->add_control( 'theme_support', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => sprintf( __( 'Note: This widget only affects themes that use `%s` in archive pages.', 'elementor' ), 'the_content' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', ] ); $this->add_control( 'link_text', [ 'label' => __( 'Read More Text', 'elementor' ), 'placeholder' => $default_link_text, 'default' => $default_link_text, ] ); $this->end_controls_section(); } /** * Render Read More widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @access protected */ protected function render() { printf( '', $this->get_settings_for_display( 'link_text' ) ); } /** * Render Read More widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() { ?> start_controls_section( 'section_image', [ 'label' => __( 'Image', 'elementor' ), ] ); $this->add_control( 'image', [ 'label' => __( 'Choose Image', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'image', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_size` and `image_custom_dimension`. 'default' => 'large', 'separator' => 'none', ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'caption_source', [ 'label' => __( 'Caption', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => __( 'None', 'elementor' ), 'attachment' => __( 'Attachment Caption', 'elementor' ), 'custom' => __( 'Custom Caption', 'elementor' ), ], 'default' => 'none', ] ); $this->add_control( 'caption', [ 'label' => __( 'Custom Caption', 'elementor' ), 'type' => Controls_Manager::TEXT, 'default' => '', 'placeholder' => __( 'Enter your image caption', 'elementor' ), 'condition' => [ 'caption_source' => 'custom', ], 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'link_to', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'none', 'options' => [ 'none' => __( 'None', 'elementor' ), 'file' => __( 'Media File', 'elementor' ), 'custom' => __( 'Custom URL', 'elementor' ), ], ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), 'condition' => [ 'link_to' => 'custom', ], 'show_label' => false, ] ); $this->add_control( 'open_lightbox', [ 'label' => __( 'Lightbox', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => __( 'Default', 'elementor' ), 'yes' => __( 'Yes', 'elementor' ), 'no' => __( 'No', 'elementor' ), ], 'condition' => [ 'link_to' => 'file', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_image', [ 'label' => __( 'Image', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'width', [ 'label' => __( 'Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'unit' => '%', ], 'tablet_default' => [ 'unit' => '%', ], 'mobile_default' => [ 'unit' => '%', ], 'size_units' => [ '%', 'px', 'vw' ], 'range' => [ '%' => [ 'min' => 1, 'max' => 100, ], 'px' => [ 'min' => 1, 'max' => 1000, ], 'vw' => [ 'min' => 1, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image img' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'space', [ 'label' => __( 'Max Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'unit' => '%', ], 'tablet_default' => [ 'unit' => '%', ], 'mobile_default' => [ 'unit' => '%', ], 'size_units' => [ '%', 'px', 'vw' ], 'range' => [ '%' => [ 'min' => 1, 'max' => 100, ], 'px' => [ 'min' => 1, 'max' => 1000, ], 'vw' => [ 'min' => 1, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image img' => 'max-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'separator_panel_style', [ 'type' => Controls_Manager::DIVIDER, 'style' => 'thick', ] ); $this->start_controls_tabs( 'image_effects' ); $this->start_controls_tab( 'normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_control( 'opacity', [ 'label' => __( 'Opacity', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 1, 'min' => 0.10, 'step' => 0.01, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image img' => 'opacity: {{SIZE}};', ], ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'css_filters', 'selector' => '{{WRAPPER}} .elementor-image img', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_control( 'opacity_hover', [ 'label' => __( 'Opacity', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 1, 'min' => 0.10, 'step' => 0.01, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image:hover img' => 'opacity: {{SIZE}};', ], ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'css_filters_hover', 'selector' => '{{WRAPPER}} .elementor-image:hover img', ] ); $this->add_control( 'background_hover_transition', [ 'label' => __( 'Transition Duration', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 3, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-image img' => 'transition-duration: {{SIZE}}s', ], ] ); $this->add_control( 'hover_animation', [ 'label' => __( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border', 'selector' => '{{WRAPPER}} .elementor-image img', 'separator' => 'before', ] ); $this->add_responsive_control( 'image_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_box_shadow', 'exclude' => [ 'box_shadow_position', ], 'selector' => '{{WRAPPER}} .elementor-image img', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style_caption', [ 'label' => __( 'Caption', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'caption_source!' => 'none', ], ] ); $this->add_control( 'caption_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => __( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .widget-image-caption' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .widget-image-caption' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], ] ); $this->add_control( 'caption_background_color', [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .widget-image-caption' => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'caption_typography', 'selector' => '{{WRAPPER}} .widget-image-caption', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'caption_text_shadow', 'selector' => '{{WRAPPER}} .widget-image-caption', ] ); $this->add_responsive_control( 'caption_space', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .widget-image-caption' => 'margin-top: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); } /** * Check if the current widget has caption * * @access private * @since 2.3.0 * * @param array $settings * * @return boolean */ private function has_caption( $settings ) { return ( ! empty( $settings['caption_source'] ) && 'none' !== $settings['caption_source'] ); } /** * Get the caption for current widget. * * @access private * @since 2.3.0 * @param $settings * * @return string */ private function get_caption( $settings ) { $caption = ''; if ( ! empty( $settings['caption_source'] ) ) { switch ( $settings['caption_source'] ) { case 'attachment': $caption = wp_get_attachment_caption( $settings['image']['id'] ); break; case 'custom': $caption = ! Utils::is_empty( $settings['caption'] ) ? $settings['caption'] : ''; } } return $caption; } /** * Render image widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); if ( empty( $settings['image']['url'] ) ) { return; } $has_caption = $this->has_caption( $settings ); $this->add_render_attribute( 'wrapper', 'class', 'elementor-image' ); if ( ! empty( $settings['shape'] ) ) { $this->add_render_attribute( 'wrapper', 'class', 'elementor-image-shape-' . $settings['shape'] ); } $link = $this->get_link_url( $settings ); if ( $link ) { $this->add_link_attributes( 'link', $link ); if ( Plugin::$instance->editor->is_edit_mode() ) { $this->add_render_attribute( 'link', [ 'class' => 'elementor-clickable', ] ); } if ( 'custom' !== $settings['link_to'] ) { $this->add_lightbox_data_attributes( 'link', $settings['image']['id'], $settings['open_lightbox'] ); } } ?>
get_render_attribute_string( 'wrapper' ); ?>>
get_render_attribute_string( 'link' ); ?>>
get_caption( $settings ); ?>
<# if ( settings.image.url ) { var image = { id: settings.image.id, url: settings.image.url, size: settings.image_size, dimension: settings.image_custom_dimension, model: view.getEditModel() }; var image_url = elementor.imagesManager.getImageUrl( image ); if ( ! image_url ) { return; } var hasCaption = function() { if( ! settings.caption_source || 'none' === settings.caption_source ) { return false; } return true; } var ensureAttachmentData = function( id ) { if ( 'undefined' === typeof wp.media.attachment( id ).get( 'caption' ) ) { wp.media.attachment( id ).fetch().then( function( data ) { view.render(); } ); } } var getAttachmentCaption = function( id ) { if ( ! id ) { return ''; } ensureAttachmentData( id ); return wp.media.attachment( id ).get( 'caption' ); } var getCaption = function() { if ( ! hasCaption() ) { return ''; } return 'custom' === settings.caption_source ? settings.caption : getAttachmentCaption( settings.image.id ); } var link_url; if ( 'custom' === settings.link_to ) { link_url = settings.link.url; } if ( 'file' === settings.link_to ) { link_url = settings.image.url; } #>
<# var imgClass = ''; if ( '' !== settings.hover_animation ) { imgClass = 'elementor-animation-' + settings.hover_animation; } if ( hasCaption() ) { #>
<# } if ( link_url ) { #><# } #><# if ( link_url ) { #><# } if ( hasCaption() ) { #>
{{{ getCaption() }}}
<# } if ( hasCaption() ) { #>
<# } #>
<# } #> $settings['image']['url'], ]; } } PKYe\Mo% % spacer.phpnuW+Astart_controls_section( 'section_spacer', [ 'label' => __( 'Spacer', 'elementor' ), ] ); $this->add_responsive_control( 'space', [ 'label' => __( 'Space', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 50, ], 'size_units' => [ 'px', 'vh', 'em' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 600, ], 'em' => [ 'min' => 0.1, 'max' => 20, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-spacer-inner' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); } /** * Render spacer widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { ?>
start_controls_section( 'section_title', [ 'label' => __( 'HTML Code', 'elementor' ), ] ); $this->add_control( 'html', [ 'label' => '', 'type' => Controls_Manager::CODE, 'default' => '', 'placeholder' => __( 'Enter your code', 'elementor' ), 'show_label' => false, ] ); $this->end_controls_section(); } /** * Render HTML widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { echo $this->get_settings_for_display( 'html' ); } /** * Render HTML widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() { ?> {{{ settings.html }}} start_controls_section( 'section_map', [ 'label' => __( 'Map', 'elementor' ), ] ); $default_address = __( 'London Eye, London, United Kingdom', 'elementor' ); $this->add_control( 'address', [ 'label' => __( 'Location', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, ], ], 'placeholder' => $default_address, 'default' => $default_address, 'label_block' => true, ] ); $this->add_control( 'zoom', [ 'label' => __( 'Zoom', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 10, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 20, ], ], 'separator' => 'before', ] ); $this->add_responsive_control( 'height', [ 'label' => __( 'Height', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 40, 'max' => 1440, ], ], 'selectors' => [ '{{WRAPPER}} iframe' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_map_style', [ 'label' => __( 'Map', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( 'map_filter' ); $this->start_controls_tab( 'normal', [ 'label' => __( 'Normal', 'elementor' ), ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'css_filters', 'selector' => '{{WRAPPER}} iframe', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'hover', [ 'label' => __( 'Hover', 'elementor' ), ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'css_filters_hover', 'selector' => '{{WRAPPER}}:hover iframe', ] ); $this->add_control( 'hover_transition', [ 'label' => __( 'Transition Duration', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 3, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} iframe' => 'transition-duration: {{SIZE}}s', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /** * Render google maps widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); if ( empty( $settings['address'] ) ) { return; } if ( 0 === absint( $settings['zoom']['size'] ) ) { $settings['zoom']['size'] = 10; } printf( '
', rawurlencode( $settings['address'] ), absint( $settings['zoom']['size'] ), esc_attr( $settings['address'] ) ); } /** * Render google maps widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() {} } PKYe\L%% progress.phpnuW+Astart_controls_section( 'section_progress', [ 'label' => __( 'Progress Bar', 'elementor' ), ] ); $this->add_control( 'title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your title', 'elementor' ), 'default' => __( 'My Skill', 'elementor' ), 'label_block' => true, ] ); $this->add_control( 'progress_type', [ 'label' => __( 'Type', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'Default', 'elementor' ), 'info' => __( 'Info', 'elementor' ), 'success' => __( 'Success', 'elementor' ), 'warning' => __( 'Warning', 'elementor' ), 'danger' => __( 'Danger', 'elementor' ), ], ] ); $this->add_control( 'percent', [ 'label' => __( 'Percentage', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 50, 'unit' => '%', ], 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'display_percentage', [ 'label' => __( 'Display Percentage', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'show', 'options' => [ 'show' => __( 'Show', 'elementor' ), 'hide' => __( 'Hide', 'elementor' ), ], ] ); $this->add_control( 'inner_text', [ 'label' => __( 'Inner Text', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'e.g. Web Designer', 'elementor' ), 'default' => __( 'Web Designer', 'elementor' ), 'label_block' => true, ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_progress_style', [ 'label' => __( 'Progress Bar', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'bar_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .elementor-progress-wrapper .elementor-progress-bar' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'bar_bg_color', [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-progress-wrapper' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'bar_height', [ 'label' => __( 'Height', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-progress-bar' => 'height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'bar_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-progress-wrapper' => 'border-radius: {{SIZE}}{{UNIT}}; overflow: hidden;', ], ] ); $this->add_control( 'inner_text_heading', [ 'label' => __( 'Inner Text', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'bar_inline_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-progress-bar' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'bar_inner_typography', 'selector' => '{{WRAPPER}} .elementor-progress-bar', 'exclude' => [ 'line_height', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title', [ 'label' => __( 'Title Style', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-title' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'selector' => '{{WRAPPER}} .elementor-title', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); } /** * Render progress widget output on the frontend. * Make sure value does no exceed 100%. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $progress_percentage = is_numeric( $settings['percent']['size'] ) ? $settings['percent']['size'] : '0'; if ( 100 < $progress_percentage ) { $progress_percentage = 100; } $this->add_render_attribute( 'title', [ 'class' => 'elementor-title', ]); $this->add_inline_editing_attributes( 'title' ); $this->add_render_attribute( 'wrapper', [ 'class' => 'elementor-progress-wrapper', 'role' => 'progressbar', 'aria-valuemin' => '0', 'aria-valuemax' => '100', 'aria-valuenow' => $progress_percentage, 'aria-valuetext' => $settings['inner_text'], ] ); if ( ! empty( $settings['progress_type'] ) ) { $this->add_render_attribute( 'wrapper', 'class', 'progress-' . $settings['progress_type'] ); } $this->add_render_attribute( 'progress-bar', [ 'class' => 'elementor-progress-bar', 'data-max' => $progress_percentage, ] ); $this->add_render_attribute( 'inner_text', [ 'class' => 'elementor-progress-text', ] ); $this->add_inline_editing_attributes( 'inner_text' ); if ( ! Utils::is_empty( $settings['title'] ) ) { ?> get_render_attribute_string( 'title' ); ?>>
get_render_attribute_string( 'wrapper' ); ?>>
get_render_attribute_string( 'progress-bar' ); ?>> get_render_attribute_string( 'inner_text' ); ?>> %
<# let progress_percentage = 0; if ( ! isNaN( settings.percent.size ) ) { progress_percentage = 100 < settings.percent.size ? 100 : settings.percent.size; } view.addRenderAttribute( 'title', { 'class': 'elementor-title' } ); view.addInlineEditingAttributes( 'title' ); view.addRenderAttribute( 'progressWrapper', { 'class': [ 'elementor-progress-wrapper', 'progress-' + settings.progress_type ], 'role': 'progressbar', 'aria-valuemin': '0', 'aria-valuemax': '100', 'aria-valuenow': progress_percentage, 'aria-valuetext': settings.inner_text } ); view.addRenderAttribute( 'inner_text', { 'class': 'elementor-progress-text' } ); view.addInlineEditingAttributes( 'inner_text' ); #> <# if ( settings.title ) { #> {{{ settings.title }}}<# } #>
{{{ settings.inner_text }}} <# if ( 'hide' !== settings.display_percentage ) { #> {{{ progress_percentage }}}% <# } #>
start_controls_section( 'section_social_icon', [ 'label' => __( 'Social Icons', 'elementor' ), ] ); $repeater = new Repeater(); $repeater->add_control( 'social_icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'social', 'default' => [ 'value' => 'fab fa-wordpress', 'library' => 'fa-brands', ], 'recommended' => [ 'fa-brands' => [ 'android', 'apple', 'behance', 'bitbucket', 'codepen', 'delicious', 'deviantart', 'digg', 'dribbble', 'elementor', 'facebook', 'flickr', 'foursquare', 'free-code-camp', 'github', 'gitlab', 'globe', 'houzz', 'instagram', 'jsfiddle', 'linkedin', 'medium', 'meetup', 'mix', 'mixcloud', 'odnoklassniki', 'pinterest', 'product-hunt', 'reddit', 'shopping-cart', 'skype', 'slideshare', 'snapchat', 'soundcloud', 'spotify', 'stack-overflow', 'steam', 'telegram', 'thumb-tack', 'tripadvisor', 'tumblr', 'twitch', 'twitter', 'viber', 'vimeo', 'vk', 'weibo', 'weixin', 'whatsapp', 'wordpress', 'xing', 'yelp', 'youtube', '500px', ], 'fa-solid' => [ 'envelope', 'link', 'rss', ], ], ] ); $repeater->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'default' => [ 'is_external' => 'true', ], 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), ] ); $repeater->add_control( 'item_icon_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => __( 'Official Color', 'elementor' ), 'custom' => __( 'Custom', 'elementor' ), ], ] ); $repeater->add_control( 'item_icon_primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'item_icon_color' => 'custom', ], 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.elementor-social-icon' => 'background-color: {{VALUE}};', ], ] ); $repeater->add_control( 'item_icon_secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'item_icon_color' => 'custom', ], 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}.elementor-social-icon i' => 'color: {{VALUE}};', '{{WRAPPER}} {{CURRENT_ITEM}}.elementor-social-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'social_icon_list', [ 'label' => __( 'Social Icons', 'elementor' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'social_icon' => [ 'value' => 'fab fa-facebook', 'library' => 'fa-brands', ], ], [ 'social_icon' => [ 'value' => 'fab fa-twitter', 'library' => 'fa-brands', ], ], [ 'social_icon' => [ 'value' => 'fab fa-youtube', 'library' => 'fa-brands', ], ], ], 'title_field' => '<# var migrated = "undefined" !== typeof __fa4_migrated, social = ( "undefined" === typeof social ) ? false : social; #>{{{ elementor.helpers.getSocialNetworkNameFromIcon( social_icon, social, true, migrated, true ) }}}', ] ); $this->add_control( 'shape', [ 'label' => __( 'Shape', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'rounded', 'options' => [ 'rounded' => __( 'Rounded', 'elementor' ), 'square' => __( 'Square', 'elementor' ), 'circle' => __( 'Circle', 'elementor' ), ], 'prefix_class' => 'elementor-shape-', ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_social_style', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'icon_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => __( 'Official Color', 'elementor' ), 'custom' => __( 'Custom', 'elementor' ), ], ] ); $this->add_control( 'icon_primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'icon_color' => 'custom', ], 'selectors' => [ '{{WRAPPER}} .elementor-social-icon' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'icon_secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'icon_color' => 'custom', ], 'selectors' => [ '{{WRAPPER}} .elementor-social-icon i' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-social-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 6, 'max' => 300, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-social-icon' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-social-icon' => 'padding: {{SIZE}}{{UNIT}};', ], 'default' => [ 'unit' => 'em', ], 'tablet_default' => [ 'unit' => 'em', ], 'mobile_default' => [ 'unit' => 'em', ], 'range' => [ 'em' => [ 'min' => 0, 'max' => 5, ], ], ] ); $icon_spacing = is_rtl() ? 'margin-left: {{SIZE}}{{UNIT}};' : 'margin-right: {{SIZE}}{{UNIT}};'; $this->add_responsive_control( 'icon_spacing', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-social-icon:not(:last-child)' => $icon_spacing, ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border', // We know this mistake - TODO: 'icon_border' (for hover control condition also) 'selector' => '{{WRAPPER}} .elementor-social-icon', 'separator' => 'before', ] ); $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_social_hover', [ 'label' => __( 'Icon Hover', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'hover_primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'icon_color' => 'custom', ], 'selectors' => [ '{{WRAPPER}} .elementor-social-icon:hover' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'hover_secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'icon_color' => 'custom', ], 'selectors' => [ '{{WRAPPER}} .elementor-social-icon:hover i' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-social-icon:hover svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'hover_border_color', [ 'label' => __( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'image_border_border!' => '', ], 'selectors' => [ '{{WRAPPER}} .elementor-social-icon:hover' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'hover_animation', [ 'label' => __( 'Hover Animation', 'elementor' ), 'type' => Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_section(); } /** * Render social icons widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $fallback_defaults = [ 'fa fa-facebook', 'fa fa-twitter', 'fa fa-google-plus', ]; $class_animation = ''; if ( ! empty( $settings['hover_animation'] ) ) { $class_animation = ' elementor-animation-' . $settings['hover_animation']; } $migration_allowed = Icons_Manager::is_migration_allowed(); ?>
$item ) { $migrated = isset( $item['__fa4_migrated']['social_icon'] ); $is_new = empty( $item['social'] ) && $migration_allowed; $social = ''; // add old default if ( empty( $item['social'] ) && ! $migration_allowed ) { $item['social'] = isset( $fallback_defaults[ $index ] ) ? $fallback_defaults[ $index ] : 'fa fa-wordpress'; } if ( ! empty( $item['social'] ) ) { $social = str_replace( 'fa fa-', '', $item['social'] ); } if ( ( $is_new || $migrated ) && 'svg' !== $item['social_icon']['library'] ) { $social = explode( ' ', $item['social_icon']['value'], 2 ); if ( empty( $social[1] ) ) { $social = ''; } else { $social = str_replace( 'fa-', '', $social[1] ); } } if ( 'svg' === $item['social_icon']['library'] ) { $social = get_post_meta( $item['social_icon']['value']['id'], '_wp_attachment_image_alt', true ); } $link_key = 'link_' . $index; $this->add_render_attribute( $link_key, 'class', [ 'elementor-icon', 'elementor-social-icon', 'elementor-social-icon-' . $social . $class_animation, 'elementor-repeater-item-' . $item['_id'], ] ); $this->add_link_attributes( $link_key, $item['link'] ); ?> get_render_attribute_string( $link_key ); ?>>
<# var iconsHTML = {}; #>
<# _.each( settings.social_icon_list, function( item, index ) { var link = item.link ? item.link.url : '', migrated = elementor.helpers.isIconMigrated( item, 'social_icon' ); social = elementor.helpers.getSocialNetworkNameFromIcon( item.social_icon, item.social, false, migrated ); #> <# } ); #>
start_controls_section( 'section_icon', [ 'label' => __( 'Icon List', 'elementor' ), ] ); $this->add_control( 'view', [ 'label' => __( 'Layout', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'traditional', 'options' => [ 'traditional' => [ 'title' => __( 'Default', 'elementor' ), 'icon' => 'eicon-editor-list-ul', ], 'inline' => [ 'title' => __( 'Inline', 'elementor' ), 'icon' => 'eicon-ellipsis-h', ], ], 'render_type' => 'template', 'classes' => 'elementor-control-start-end', 'style_transfer' => true, 'prefix_class' => 'elementor-icon-list--layout-', ] ); $repeater = new Repeater(); $repeater->add_control( 'text', [ 'label' => __( 'Text', 'elementor' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => __( 'List Item', 'elementor' ), 'default' => __( 'List Item', 'elementor' ), 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'selected_icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-check', 'library' => 'fa-solid', ], 'fa4compatibility' => 'icon', ] ); $repeater->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), ] ); $this->add_control( 'icon_list', [ 'label' => '', 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'text' => __( 'List Item #1', 'elementor' ), 'selected_icon' => [ 'value' => 'fas fa-check', 'library' => 'fa-solid', ], ], [ 'text' => __( 'List Item #2', 'elementor' ), 'selected_icon' => [ 'value' => 'fas fa-times', 'library' => 'fa-solid', ], ], [ 'text' => __( 'List Item #3', 'elementor' ), 'selected_icon' => [ 'value' => 'fas fa-dot-circle', 'library' => 'fa-solid', ], ], ], 'title_field' => '{{{ elementor.helpers.renderIcon( this, selected_icon, {}, "i", "panel" ) || \'\' }}} {{{ text }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon_list', [ 'label' => __( 'List', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'space_between', [ 'label' => __( 'Space Between', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child)' => 'padding-bottom: calc({{SIZE}}{{UNIT}}/2)', '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:first-child)' => 'margin-top: calc({{SIZE}}{{UNIT}}/2)', '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item' => 'margin-right: calc({{SIZE}}{{UNIT}}/2); margin-left: calc({{SIZE}}{{UNIT}}/2)', '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items' => 'margin-right: calc(-{{SIZE}}{{UNIT}}/2); margin-left: calc(-{{SIZE}}{{UNIT}}/2)', 'body.rtl {{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'left: calc(-{{SIZE}}{{UNIT}}/2)', 'body:not(.rtl) {{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'right: calc(-{{SIZE}}{{UNIT}}/2)', ], ] ); $this->add_responsive_control( 'icon_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'prefix_class' => 'elementor%s-align-', ] ); $this->add_control( 'divider', [ 'label' => __( 'Divider', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Off', 'elementor' ), 'label_on' => __( 'On', 'elementor' ), 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'content: ""', ], 'separator' => 'before', ] ); $this->add_control( 'divider_style', [ 'label' => __( 'Style', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'solid' => __( 'Solid', 'elementor' ), 'double' => __( 'Double', 'elementor' ), 'dotted' => __( 'Dotted', 'elementor' ), 'dashed' => __( 'Dashed', 'elementor' ), ], 'default' => 'solid', 'condition' => [ 'divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-top-style: {{VALUE}}', '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-left-style: {{VALUE}}', ], ] ); $this->add_control( 'divider_weight', [ 'label' => __( 'Weight', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 20, ], ], 'condition' => [ 'divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-top-width: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-left-width: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'divider_width', [ 'label' => __( 'Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'unit' => '%', ], 'condition' => [ 'divider' => 'yes', 'view!' => 'inline', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'width: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'divider_height', [ 'label' => __( 'Height', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'default' => [ 'unit' => '%', ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 100, ], '%' => [ 'min' => 1, 'max' => 100, ], ], 'condition' => [ 'divider' => 'yes', 'view' => 'inline', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'height: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'divider_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '#ddd', 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], 'condition' => [ 'divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'border-color: {{VALUE}}', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon_style', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'icon_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-icon i' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-icon-list-icon svg' => 'fill: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_control( 'icon_color_hover', [ 'label' => __( 'Hover', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:hover .elementor-icon-list-icon i' => 'color: {{VALUE}};', '{{WRAPPER}} .elementor-icon-list-item:hover .elementor-icon-list-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 14, ], 'range' => [ 'px' => [ 'min' => 6, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-icon i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .elementor-icon-list-icon svg' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_self_align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-icon' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_text_style', [ 'label' => __( 'Text', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-text' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_2, ], ] ); $this->add_control( 'text_color_hover', [ 'label' => __( 'Hover', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-item:hover .elementor-icon-list-text' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'text_indent', [ 'label' => __( 'Text Indent', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-icon-list-text' => is_rtl() ? 'padding-right: {{SIZE}}{{UNIT}};' : 'padding-left: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'icon_typography', 'selector' => '{{WRAPPER}} .elementor-icon-list-item', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); } /** * Render icon list widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $fallback_defaults = [ 'fa fa-check', 'fa fa-times', 'fa fa-dot-circle-o', ]; $this->add_render_attribute( 'icon_list', 'class', 'elementor-icon-list-items' ); $this->add_render_attribute( 'list_item', 'class', 'elementor-icon-list-item' ); if ( 'inline' === $settings['view'] ) { $this->add_render_attribute( 'icon_list', 'class', 'elementor-inline-items' ); $this->add_render_attribute( 'list_item', 'class', 'elementor-inline-item' ); } ?> <# view.addRenderAttribute( 'icon_list', 'class', 'elementor-icon-list-items' ); view.addRenderAttribute( 'list_item', 'class', 'elementor-icon-list-item' ); if ( 'inline' == settings.view ) { view.addRenderAttribute( 'icon_list', 'class', 'elementor-inline-items' ); view.addRenderAttribute( 'list_item', 'class', 'elementor-inline-item' ); } var iconsHTML = {}, migrated = {}; #> <# if ( settings.icon_list ) { #> <# } #> start_controls_section( 'section_tabs', [ 'label' => __( 'Tabs', 'elementor' ), ] ); $repeater = new Repeater(); $repeater->add_control( 'tab_title', [ 'label' => __( 'Title & Description', 'elementor' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Tab Title', 'elementor' ), 'placeholder' => __( 'Tab Title', 'elementor' ), 'label_block' => true, ] ); $repeater->add_control( 'tab_content', [ 'label' => __( 'Content', 'elementor' ), 'default' => __( 'Tab Content', 'elementor' ), 'placeholder' => __( 'Tab Content', 'elementor' ), 'type' => Controls_Manager::WYSIWYG, 'show_label' => false, 'dynamic' => [ 'active' => false, ], ] ); $this->add_control( 'tabs', [ 'label' => __( 'Tabs Items', 'elementor' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'tab_title' => __( 'Tab #1', 'elementor' ), 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), ], [ 'tab_title' => __( 'Tab #2', 'elementor' ), 'tab_content' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), ], ], 'title_field' => '{{{ tab_title }}}', ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->add_control( 'type', [ 'label' => __( 'Type', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'horizontal', 'options' => [ 'horizontal' => __( 'Horizontal', 'elementor' ), 'vertical' => __( 'Vertical', 'elementor' ), ], 'prefix_class' => 'elementor-tabs-view-', 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_tabs_style', [ 'label' => __( 'Tabs', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'navigation_width', [ 'label' => __( 'Navigation Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'unit' => '%', ], 'range' => [ '%' => [ 'min' => 10, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-tabs-wrapper' => 'width: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'type' => 'vertical', ], ] ); $this->add_control( 'border_width', [ 'label' => __( 'Border Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-tab-title, {{WRAPPER}} .elementor-tab-title:before, {{WRAPPER}} .elementor-tab-title:after, {{WRAPPER}} .elementor-tab-content, {{WRAPPER}} .elementor-tabs-content-wrapper' => 'border-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'border_color', [ 'label' => __( 'Border Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-mobile-title, {{WRAPPER}} .elementor-tab-desktop-title.elementor-active, {{WRAPPER}} .elementor-tab-title:before, {{WRAPPER}} .elementor-tab-title:after, {{WRAPPER}} .elementor-tab-content, {{WRAPPER}} .elementor-tabs-content-wrapper' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'background_color', [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-desktop-title.elementor-active' => 'background-color: {{VALUE}};', '{{WRAPPER}} .elementor-tabs-content-wrapper' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'heading_title', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'tab_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-title, {{WRAPPER}} .elementor-tab-title a' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], ] ); $this->add_control( 'tab_active_color', [ 'label' => __( 'Active Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-title.elementor-active a' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_4, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'tab_typography', 'selector' => '{{WRAPPER}} .elementor-tab-title', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, ] ); $this->add_control( 'heading_content', [ 'label' => __( 'Content', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'content_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-content' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .elementor-tab-content', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); } /** * Render tabs widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $tabs = $this->get_settings_for_display( 'tabs' ); $id_int = substr( $this->get_id_int(), 0, 3 ); ?>
$item ) : $tab_count = $index + 1; $tab_title_setting_key = $this->get_repeater_setting_key( 'tab_title', 'tabs', $index ); $this->add_render_attribute( $tab_title_setting_key, [ 'id' => 'elementor-tab-title-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-title', 'elementor-tab-desktop-title' ], 'data-tab' => $tab_count, 'role' => 'tab', 'aria-controls' => 'elementor-tab-content-' . $id_int . $tab_count, ] ); ?>
get_render_attribute_string( $tab_title_setting_key ); ?>>
$item ) : $tab_count = $index + 1; $tab_content_setting_key = $this->get_repeater_setting_key( 'tab_content', 'tabs', $index ); $tab_title_mobile_setting_key = $this->get_repeater_setting_key( 'tab_title_mobile', 'tabs', $tab_count ); $this->add_render_attribute( $tab_content_setting_key, [ 'id' => 'elementor-tab-content-' . $id_int . $tab_count, 'class' => [ 'elementor-tab-content', 'elementor-clearfix' ], 'data-tab' => $tab_count, 'role' => 'tabpanel', 'aria-labelledby' => 'elementor-tab-title-' . $id_int . $tab_count, ] ); $this->add_render_attribute( $tab_title_mobile_setting_key, [ 'class' => [ 'elementor-tab-title', 'elementor-tab-mobile-title' ], 'data-tab' => $tab_count, 'role' => 'tab', ] ); $this->add_inline_editing_attributes( $tab_content_setting_key, 'advanced' ); ?>
get_render_attribute_string( $tab_title_mobile_setting_key ); ?>>
get_render_attribute_string( $tab_content_setting_key ); ?>>parse_text_editor( $item['tab_content'] ); ?>
<# if ( settings.tabs ) { var tabindex = view.getIDInt().toString().substr( 0, 3 ); #>
<# _.each( settings.tabs, function( item, index ) { var tabCount = index + 1; #> <# } ); #>
<# _.each( settings.tabs, function( item, index ) { var tabCount = index + 1, tabContentKey = view.getRepeaterSettingKey( 'tab_content', 'tabs',index ); view.addRenderAttribute( tabContentKey, { 'id': 'elementor-tab-content-' + tabindex + tabCount, 'class': [ 'elementor-tab-content', 'elementor-clearfix', 'elementor-repeater-item-' + item._id ], 'data-tab': tabCount, 'role' : 'tabpanel', 'aria-labelledby' : 'elementor-tab-title-' + tabindex + tabCount } ); view.addInlineEditingAttributes( tabContentKey, 'advanced' ); #>
{{{ item.tab_content }}}
<# } ); #>
<# } #>
[ 'label' => _x( 'Curly', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'group' => 'line', ], 'curved' => [ 'label' => _x( 'Curved', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'group' => 'line', ], 'multiple' => [ 'label' => _x( 'Multiple', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => false, 'round' => false, 'group' => 'pattern', ], 'slashes' => [ 'label' => _x( 'Slashes', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'view_box' => '0 0 20 16', 'group' => 'line', ], 'squared' => [ 'label' => _x( 'Squared', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'group' => 'line', ], 'wavy' => [ 'label' => _x( 'Wavy', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'group' => 'line', ], 'zigzag' => [ 'label' => _x( 'Zigzag', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'group' => 'line', ], 'arrows' => [ 'label' => _x( 'Arrows', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => true, 'round' => true, 'group' => 'pattern', ], 'pluses' => [ 'label' => _x( 'Pluses', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => true, 'round' => false, 'group' => 'pattern', ], 'rhombus' => [ 'label' => _x( 'Rhombus', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'group' => 'pattern', ], 'parallelogram' => [ 'label' => _x( 'Parallelogram', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => false, 'group' => 'pattern', ], 'rectangles' => [ 'label' => _x( 'Rectangles', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => false, 'supports_amount' => true, 'round' => true, 'group' => 'pattern', 'view_box' => '0 0 60 30', ], 'dots_tribal' => [ 'label' => _x( 'Dots', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 126 26', ], 'trees_2_tribal' => [ 'label' => _x( 'Fir Tree', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 126 26', ], 'rounds_tribal' => [ 'label' => _x( 'Half Rounds', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 120 26', ], 'leaves_tribal' => [ 'label' => _x( 'Leaves', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 117 26', ], 'stripes_tribal' => [ 'label' => _x( 'Stripes', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 120 26', ], 'squares_tribal' => [ 'label' => _x( 'Squares', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 126 26', ], 'trees_tribal' => [ 'label' => _x( 'Trees', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 123 26', ], 'planes_tribal' => [ 'label' => _x( 'Tribal', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 121 26', ], 'x_tribal' => [ 'label' => _x( 'X', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 126 26', ], 'zigzag_tribal' => [ 'label' => _x( 'Zigzag', 'shapes', 'elementor' ), 'shape' => '', 'preserve_aspect_ratio' => true, 'supports_amount' => false, 'round' => false, 'group' => 'tribal', 'view_box' => '0 0 120 26', ], ] ); } private function filter_styles_by( $array, $key, $value ) { return array_filter( $array, function( $style ) use ( $key, $value ) { return $value === $style[ $key ]; } ); } private function get_options_by_groups( $styles, $group = false ) { $groups = [ 'line' => [ 'label' => __( 'Line', 'elementor' ), 'options' => [ 'solid' => __( 'Solid', 'elementor' ), 'double' => __( 'Double', 'elementor' ), 'dotted' => __( 'Dotted', 'elementor' ), 'dashed' => __( 'Dashed', 'elementor' ), ], ], ]; foreach ( $styles as $key => $style ) { if ( ! isset( $groups[ $style['group'] ] ) ) { $groups[ $style['group'] ] = [ 'label' => ucwords( str_replace( '_', '', $style['group'] ) ), 'options' => [], ]; } $groups[ $style['group'] ]['options'][ $key ] = $style['label']; } if ( $group && isset( $groups[ $group ] ) ) { return $groups[ $group ]; } return $groups; } /** * Register divider widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function _register_controls() { $styles = $this->get_separator_styles(); $this->start_controls_section( 'section_divider', [ 'label' => __( 'Divider', 'elementor' ), ] ); $this->add_control( 'style', [ 'label' => __( 'Style', 'elementor' ), 'type' => Controls_Manager::SELECT, 'groups' => array_values( $this->get_options_by_groups( $styles ) ), 'render_type' => 'template', 'default' => 'solid', 'selectors' => [ '{{WRAPPER}}' => '--divider-border-style: {{VALUE}}', ], ] ); $this->add_control( 'separator_type', [ 'type' => Controls_Manager::HIDDEN, 'default' => 'pattern', 'prefix_class' => 'elementor-widget-divider--separator-type-', 'condition' => [ 'style!' => [ '', 'solid', 'double', 'dotted', 'dashed', ], ], 'render_type' => 'template', ] ); $this->add_control( 'pattern_spacing_flag', [ 'type' => Controls_Manager::HIDDEN, 'default' => 'no-spacing', 'prefix_class' => 'elementor-widget-divider--', 'condition' => [ 'style' => array_keys( $this->filter_styles_by( $styles, 'supports_amount', false ) ), ], 'render_type' => 'template', ] ); $this->add_control( 'pattern_round_flag', [ 'type' => Controls_Manager::HIDDEN, 'default' => 'bg-round', 'prefix_class' => 'elementor-widget-divider--', 'condition' => [ 'style' => array_keys( $this->filter_styles_by( $styles, 'round', true ) ), ], ] ); $this->add_responsive_control( 'width', [ 'label' => __( 'Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'range' => [ 'px' => [ 'max' => 1000, ], ], 'default' => [ 'size' => 100, 'unit' => '%', ], 'tablet_default' => [ 'unit' => '%', ], 'mobile_default' => [ 'unit' => '%', ], 'selectors' => [ '{{WRAPPER}} .elementor-divider-separator' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'align', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-divider' => 'text-align: {{VALUE}}', '{{WRAPPER}} .elementor-divider-separator' => 'margin: 0 auto; margin-{{VALUE}}: 0', ], ] ); $this->add_control( 'look', [ 'label' => __( 'Add Element', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'line' => [ 'title' => __( 'None', 'elementor' ), 'icon' => 'eicon-ban', ], 'line_text' => [ 'title' => __( 'Text', 'elementor' ), 'icon' => 'eicon-t-letter-bold', ], 'line_icon' => [ 'title' => __( 'Icon', 'elementor' ), 'icon' => 'eicon-star', ], ], 'separator' => 'before', 'prefix_class' => 'elementor-widget-divider--view-', 'render_type' => 'template', ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->add_control( 'text', [ 'label' => __( 'Text', 'elementor' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'look' => 'line_text', ], 'default' => __( 'Divider', 'elementor' ), 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'icon', [ 'label' => __( 'Icon', 'elementor' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-star', 'library' => 'fa-solid', ], 'condition' => [ 'look' => 'line_icon', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_divider_style', [ 'label' => __( 'Divider', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'style!' => 'none', ], ] ); $this->add_control( 'color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_2, ], 'default' => '#000', 'render_type' => 'template', 'selectors' => [ '{{WRAPPER}}' => '--divider-border-color: {{VALUE}}', ], ] ); $this->add_control( 'weight', [ 'label' => __( 'Weight', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 10, 'step' => 0.1, ], ], 'render_type' => 'template', 'condition' => [ 'style' => array_keys( $this->get_options_by_groups( $styles, 'line' )['options'] ), ], 'selectors' => [ '{{WRAPPER}}' => '--divider-border-width: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'pattern_height', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}}' => '--divider-pattern-height: {{SIZE}}{{UNIT}}', ], 'default' => [ 'size' => 20, ], 'range' => [ 'px' => [ 'step' => 0.1, ], ], 'condition' => [ 'style!' => [ '', 'solid', 'double', 'dotted', 'dashed', ], ], ] ); $this->add_control( 'pattern_size', [ 'label' => __( 'Amount', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'selectors' => [ '{{WRAPPER}}' => '--divider-pattern-size: {{SIZE}}{{UNIT}}', ], 'default' => [ 'size' => 20, ], 'range' => [ 'px' => [ 'step' => 0.1, ], '%' => [ 'step' => 0.01, ], ], 'condition' => [ 'style!' => array_merge( array_keys( $this->filter_styles_by( $styles, 'supports_amount', false ) ), [ '', 'solid', 'double', 'dotted', 'dashed', ] ), ], ] ); $this->add_responsive_control( 'gap', [ 'label' => __( 'Gap', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 15, ], 'range' => [ 'px' => [ 'min' => 2, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-divider' => 'padding-top: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_text_style', [ 'label' => __( 'Text', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'look' => 'line_text', ], ] ); $this->add_control( 'text_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_2, ], 'selectors' => [ '{{WRAPPER}} .elementor-divider__text' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_2, 'selector' => '{{WRAPPER}} .elementor-divider__text', ] ); $this->add_control( 'text_align', [ 'label' => __( 'Position', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => 'center', 'prefix_class' => 'elementor-widget-divider--element-align-', ] ); $this->add_responsive_control( 'text_spacing', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}}' => '--divider-element-spacing: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_icon_style', [ 'label' => __( 'Icon', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'look' => 'line_icon', ], ] ); $this->add_control( 'icon_view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'default' => __( 'Default', 'elementor' ), 'stacked' => __( 'Stacked', 'elementor' ), 'framed' => __( 'Framed', 'elementor' ), ], 'default' => 'default', 'prefix_class' => 'elementor-view-', ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 6, 'max' => 300, ], ], 'selectors' => [ '{{WRAPPER}}' => '--divider-icon-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_padding', [ 'label' => __( 'Padding', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'padding: {{SIZE}}{{UNIT}};', ], 'range' => [ 'em' => [ 'min' => 0, 'max' => 5, ], ], 'condition' => [ 'icon_view!' => 'default', ], ] ); $this->add_control( 'primary_color', [ 'label' => __( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon' => 'color: {{VALUE}}; border-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-framed .elementor-icon, {{WRAPPER}}.elementor-view-default .elementor-icon svg' => 'fill: {{VALUE}};', ], 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_2, ], ] ); $this->add_control( 'secondary_color', [ 'label' => __( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'icon_view!' => 'default', ], 'selectors' => [ '{{WRAPPER}}.elementor-view-framed .elementor-icon' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon' => 'color: {{VALUE}};', '{{WRAPPER}}.elementor-view-stacked .elementor-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_align', [ 'label' => __( 'Position', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => 'center', 'prefix_class' => 'elementor-widget-divider--element-align-', ] ); $this->add_responsive_control( 'icon_spacing', [ 'label' => __( 'Spacing', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}}' => '--divider-element-spacing: {{SIZE}}{{UNIT}}', ], ] ); $this->add_responsive_control( 'rotate', [ 'label' => __( 'Rotate', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'deg' ], 'default' => [ 'size' => 0, 'unit' => 'deg', ], 'tablet_default' => [ 'unit' => 'deg', ], 'mobile_default' => [ 'unit' => 'deg', ], 'selectors' => [ '{{WRAPPER}} .elementor-icon i, {{WRAPPER}} .elementor-icon svg' => 'transform: rotate({{SIZE}}{{UNIT}})', ], ] ); $this->add_control( 'icon_border_width', [ 'label' => __( 'Border Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'border-width: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'icon_view' => 'framed', ], ] ); $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-icon' => 'border-radius: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'icon_view!' => 'default', ], ] ); $this->end_controls_section(); } /** * Build SVG * * Build SVG element markup based on the widgets settings. * * @return string - An SVG element. * * @since 2.7.0 * @access private */ private function build_svg() { $settings = $this->get_settings_for_display(); if ( 'pattern' !== $settings['separator_type'] || empty( $settings['style'] ) ) { return ''; } $svg_shapes = $this->get_separator_styles(); $selected_pattern = $svg_shapes[ $settings['style'] ]; $preserve_aspect_ratio = $selected_pattern['preserve_aspect_ratio'] ? 'xMidYMid meet' : 'none'; $view_box = isset( $selected_pattern['view_box'] ) ? $selected_pattern['view_box'] : '0 0 24 24'; $attr = [ 'preserveAspectRatio' => $preserve_aspect_ratio, 'overflow' => 'visible', 'height' => '100%', 'viewBox' => $view_box, ]; if ( 'line' !== $selected_pattern['group'] ) { $attr['fill'] = $settings['color']; $attr['stroke'] = 'none'; } else { $attr['stroke'] = $settings['color']; $attr['stroke-width'] = $settings['weight']['size']; $attr['fill'] = 'none'; $attr['stroke-linecap'] = 'square'; $attr['stroke-miterlimit'] = '10'; } $this->add_render_attribute( 'svg', $attr ); $pattern_attribute_string = $this->get_render_attribute_string( 'svg' ); $shape = $selected_pattern['shape']; return '' . $shape . ''; } public function svg_to_data_uri( $svg ) { return str_replace( [ '<', '>', '"', '#' ], [ '%3C', '%3E', "'", '%23' ], $svg ); } /** * Render divider widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $svg_code = $this->build_svg(); $has_icon = 'line_icon' === ( $settings['look'] ) && ! empty( $settings['icon'] ); $has_text = 'line_text' === ( $settings['look'] ) && ! empty( $settings['text'] ); $this->add_render_attribute( 'wrapper', 'class', 'elementor-divider' ); if ( ! empty( $svg_code ) ) { $this->add_render_attribute( 'wrapper', 'style', '--divider-pattern-url: url("data:image/svg+xml,' . $this->svg_to_data_uri( $svg_code ) . '");' ); } ?>
get_render_attribute_string( 'wrapper' ); ?>>
'true', ] ); ?>
add_inline_editing_attributes( 'text' ); $this->add_render_attribute( 'text', [ 'class' => [ 'elementor-divider__text', 'elementor-divider__element' ] ] ); ?> get_render_attribute_string( 'text' ); ?>>
start_controls_section( 'section_anchor', [ 'label' => __( 'Anchor', 'elementor' ), ] ); $this->add_control( 'anchor', [ 'label' => __( 'The ID of Menu Anchor.', 'elementor' ), 'type' => Controls_Manager::TEXT, 'placeholder' => __( 'For Example: About', 'elementor' ), 'description' => __( 'This ID will be the CSS ID you will have to use in your own page, Without #.', 'elementor' ), 'label_block' => true, ] ); $this->add_control( 'anchor_note', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => sprintf( __( 'Note: The ID link ONLY accepts these chars: %s', 'elementor' ), '`A-Z, a-z, 0-9, _ , -`' ), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', ] ); $this->end_controls_section(); } /** * Render menu anchor widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $anchor = $this->get_settings_for_display( 'anchor' ); if ( ! empty( $anchor ) ) { $this->add_render_attribute( 'inner', 'id', sanitize_html_class( $anchor ) ); } $this->add_render_attribute( 'inner', 'class', 'elementor-menu-anchor' ); ?>
get_render_attribute_string( 'inner' ); ?>>
get_widget_instance() instanceof \Pojo_Widget_Base; } /** * Get widget name. * * Retrieve WordPress/Pojo widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'wp-widget-' . $this->get_widget_instance()->id_base; } /** * Get widget title. * * Retrieve WordPress/Pojo widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return $this->get_widget_instance()->name; } /** * Get widget categories. * * Retrieve the list of categories the WordPress/Pojo widget belongs to. * * Used to determine where to display the widget in the editor. * * @since 1.0.0 * @access public * * @return array Widget categories. Returns either a WordPress category or Pojo category. */ public function get_categories() { if ( $this->is_pojo_widget() ) { $category = 'pojo'; } else { $category = 'wordpress'; // WPCS: spelling ok. } return [ $category ]; } /** * Get widget icon. * * Retrieve WordPress/Pojo widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. Returns either a WordPress icon or Pojo icon. */ public function get_icon() { if ( $this->is_pojo_widget() ) { return 'eicon-pojome'; } return 'eicon-wordpress'; } /** * Get widget keywords. * * Retrieve the list of keywords the widget belongs to. * * @since 2.1.0 * @access public * * @return array Widget keywords. */ public function get_keywords() { return [ 'wordpress', 'widget' ]; } public function get_help_url() { return ''; } /** * Whether the reload preview is required or not. * * Used to determine whether the reload preview is required. * * @since 1.0.0 * @access public * * @return bool Whether the reload preview is required. */ public function is_reload_preview_required() { return true; } /** * Retrieve WordPress/Pojo widget form. * * Returns the WordPress widget form, to be used in Elementor. * * @since 1.0.0 * @access public * * @return string Widget form. */ public function get_form() { $instance = $this->get_widget_instance(); ob_start(); echo '
'; echo ''; echo ''; echo '
'; $widget_data = $this->get_settings( 'wp' ); $instance->form( $widget_data ); do_action( 'in_widget_form', $instance, null, $widget_data ); echo '
'; return ob_get_clean(); } /** * Retrieve WordPress/Pojo widget instance. * * Returns an instance of WordPress widget, to be used in Elementor. * * @since 1.0.0 * @access public * * @return \WP_Widget */ public function get_widget_instance() { if ( is_null( $this->_widget_instance ) ) { global $wp_widget_factory; if ( isset( $wp_widget_factory->widgets[ $this->_widget_name ] ) ) { $this->_widget_instance = $wp_widget_factory->widgets[ $this->_widget_name ]; $this->_widget_instance->_set( 'REPLACE_TO_ID' ); } elseif ( class_exists( $this->_widget_name ) ) { $this->_widget_instance = new $this->_widget_name(); $this->_widget_instance->_set( 'REPLACE_TO_ID' ); } } return $this->_widget_instance; } /** * Retrieve WordPress/Pojo widget parsed settings. * * Returns the WordPress widget settings, to be used in Elementor. * * @access protected * @since 2.3.0 * * @return array Parsed settings. */ protected function get_init_settings() { $settings = parent::get_init_settings(); if ( ! empty( $settings['wp'] ) ) { $widget = $this->get_widget_instance(); $instance = $widget->update( $settings['wp'], [] ); $settings['wp'] = apply_filters( 'widget_update_callback', $instance, $settings['wp'], [], $widget ); } return $settings; } /** * Register WordPress/Pojo widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function _register_controls() { $this->add_control( 'wp', [ 'label' => __( 'Form', 'elementor' ), 'type' => Controls_Manager::WP_WIDGET, 'widget' => $this->get_name(), 'id_base' => $this->get_widget_instance()->id_base, ] ); } /** * Render WordPress/Pojo widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $default_widget_args = [ 'widget_id' => $this->get_name(), 'before_widget' => '', 'after_widget' => '', 'before_title' => '
', 'after_title' => '
', ]; /** * WordPress widget args. * * Filters the WordPress widget arguments when they are rendered in Elementor panel. * * @since 1.0.0 * * @param array $default_widget_args Default widget arguments. * @param Widget_WordPress $this The WordPress widget. */ $default_widget_args = apply_filters( 'elementor/widgets/wordpress/widget_args', $default_widget_args, $this ); $is_gallery_widget = 'wp-widget-media_gallery' === $this->get_name(); if ( $is_gallery_widget ) { add_filter( 'wp_get_attachment_link', [ $this, 'add_lightbox_data_to_image_link' ], 10, 2 ); } $this->get_widget_instance()->widget( $default_widget_args, $this->get_settings( 'wp' ) ); if ( $is_gallery_widget ) { remove_filter( 'wp_get_attachment_link', [ $this, 'add_lightbox_data_to_image_link' ] ); } } /** * Render WordPress/Pojo widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() {} /** * WordPress/Pojo widget constructor. * * Used to run WordPress widget constructor. * * @since 1.0.0 * @access public * * @param array $data Widget data. Default is an empty array. * @param array $args Widget arguments. Default is null. */ public function __construct( $data = [], $args = null ) { $this->_widget_name = $args['widget_name']; parent::__construct( $data, $args ); } /** * Render WordPress/Pojo widget as plain content. * * Override the default render behavior, don't render widget content. * * @since 1.0.0 * @access public * * @param array $instance Widget instance. Default is empty array. */ public function render_plain_content( $instance = [] ) {} } PKYe\/Q shortcode.phpnuW+Astart_controls_section( 'section_shortcode', [ 'label' => __( 'Shortcode', 'elementor' ), ] ); $this->add_control( 'shortcode', [ 'label' => __( 'Enter your shortcode', 'elementor' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => '[gallery id="123" size="medium"]', 'default' => '', ] ); $this->end_controls_section(); } /** * Render shortcode widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $shortcode = $this->get_settings_for_display( 'shortcode' ); $shortcode = do_shortcode( shortcode_unautop( $shortcode ) ); ?>
get_settings( 'shortcode' ); } /** * Render shortcode widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 2.9.0 * @access protected */ protected function content_template() {} } PKYe\(bb video.phpnuW+Astart_controls_section( 'section_video', [ 'label' => __( 'Video', 'elementor' ), ] ); $this->add_control( 'video_type', [ 'label' => __( 'Source', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'youtube', 'options' => [ 'youtube' => __( 'YouTube', 'elementor' ), 'vimeo' => __( 'Vimeo', 'elementor' ), 'dailymotion' => __( 'Dailymotion', 'elementor' ), 'hosted' => __( 'Self Hosted', 'elementor' ), ], ] ); $this->add_control( 'youtube_url', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::URL_CATEGORY, ], ], 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (YouTube)', 'default' => 'https://www.youtube.com/watch?v=XHOmBV4js_E', 'label_block' => true, 'condition' => [ 'video_type' => 'youtube', ], ] ); $this->add_control( 'vimeo_url', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::URL_CATEGORY, ], ], 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (Vimeo)', 'default' => 'https://vimeo.com/235215203', 'label_block' => true, 'condition' => [ 'video_type' => 'vimeo', ], ] ); $this->add_control( 'dailymotion_url', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::URL_CATEGORY, ], ], 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (Dailymotion)', 'default' => 'https://www.dailymotion.com/video/x6tqhqb', 'label_block' => true, 'condition' => [ 'video_type' => 'dailymotion', ], ] ); $this->add_control( 'insert_url', [ 'label' => __( 'External URL', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'video_type' => 'hosted', ], ] ); $this->add_control( 'hosted_url', [ 'label' => __( 'Choose File', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::MEDIA_CATEGORY, ], ], 'media_type' => 'video', 'condition' => [ 'video_type' => 'hosted', 'insert_url' => '', ], ] ); $this->add_control( 'external_url', [ 'label' => __( 'URL', 'elementor' ), 'type' => Controls_Manager::URL, 'autocomplete' => false, 'options' => false, 'label_block' => true, 'show_label' => false, 'dynamic' => [ 'active' => true, 'categories' => [ TagsModule::POST_META_CATEGORY, TagsModule::URL_CATEGORY, ], ], 'media_type' => 'video', 'placeholder' => __( 'Enter your URL', 'elementor' ), 'condition' => [ 'video_type' => 'hosted', 'insert_url' => 'yes', ], ] ); $this->add_control( 'start', [ 'label' => __( 'Start Time', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'description' => __( 'Specify a start time (in seconds)', 'elementor' ), 'condition' => [ 'loop' => '', ], ] ); $this->add_control( 'end', [ 'label' => __( 'End Time', 'elementor' ), 'type' => Controls_Manager::NUMBER, 'description' => __( 'Specify an end time (in seconds)', 'elementor' ), 'condition' => [ 'loop' => '', 'video_type' => [ 'youtube', 'hosted' ], ], ] ); $this->add_control( 'video_options', [ 'label' => __( 'Video Options', 'elementor' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'autoplay', [ 'label' => __( 'Autoplay', 'elementor' ), 'type' => Controls_Manager::SWITCHER, ] ); $this->add_control( 'play_on_mobile', [ 'label' => __( 'Play On Mobile', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'autoplay' => 'yes', ], ] ); $this->add_control( 'mute', [ 'label' => __( 'Mute', 'elementor' ), 'type' => Controls_Manager::SWITCHER, ] ); $this->add_control( 'loop', [ 'label' => __( 'Loop', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'video_type!' => 'dailymotion', ], ] ); $this->add_control( 'controls', [ 'label' => __( 'Player Controls', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', 'condition' => [ 'video_type!' => 'vimeo', ], ] ); $this->add_control( 'showinfo', [ 'label' => __( 'Video Info', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', 'condition' => [ 'video_type' => [ 'dailymotion' ], ], ] ); $this->add_control( 'modestbranding', [ 'label' => __( 'Modest Branding', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'video_type' => [ 'youtube' ], 'controls' => 'yes', ], ] ); $this->add_control( 'logo', [ 'label' => __( 'Logo', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', 'condition' => [ 'video_type' => [ 'dailymotion' ], ], ] ); $this->add_control( 'color', [ 'label' => __( 'Controls Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'video_type' => [ 'vimeo', 'dailymotion' ], ], ] ); // YouTube. $this->add_control( 'yt_privacy', [ 'label' => __( 'Privacy Mode', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'description' => __( 'When you turn on privacy mode, YouTube won\'t store information about visitors on your website unless they play the video.', 'elementor' ), 'condition' => [ 'video_type' => 'youtube', ], ] ); $this->add_control( 'rel', [ 'label' => __( 'Suggested Videos', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => __( 'Current Video Channel', 'elementor' ), 'yes' => __( 'Any Video', 'elementor' ), ], 'condition' => [ 'video_type' => 'youtube', ], ] ); // Vimeo. $this->add_control( 'vimeo_title', [ 'label' => __( 'Intro Title', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', 'condition' => [ 'video_type' => 'vimeo', ], ] ); $this->add_control( 'vimeo_portrait', [ 'label' => __( 'Intro Portrait', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', 'condition' => [ 'video_type' => 'vimeo', ], ] ); $this->add_control( 'vimeo_byline', [ 'label' => __( 'Intro Byline', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'default' => 'yes', 'condition' => [ 'video_type' => 'vimeo', ], ] ); $this->add_control( 'download_button', [ 'label' => __( 'Download Button', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), 'condition' => [ 'video_type' => 'hosted', ], ] ); $this->add_control( 'poster', [ 'label' => __( 'Poster', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'condition' => [ 'video_type' => 'hosted', ], ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'youtube', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_image_overlay', [ 'label' => __( 'Image Overlay', 'elementor' ), ] ); $this->add_control( 'show_image_overlay', [ 'label' => __( 'Image Overlay', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => __( 'Hide', 'elementor' ), 'label_on' => __( 'Show', 'elementor' ), ] ); $this->add_control( 'image_overlay', [ 'label' => __( 'Choose Image', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'dynamic' => [ 'active' => true, ], 'condition' => [ 'show_image_overlay' => 'yes', ], ] ); $this->add_control( 'lazy_load', [ 'label' => __( 'Lazy Load', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'show_image_overlay' => 'yes', 'video_type!' => 'hosted', ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'image_overlay', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_overlay_size` and `image_overlay_custom_dimension`. 'default' => 'full', 'separator' => 'none', 'condition' => [ 'show_image_overlay' => 'yes', ], ] ); $this->add_control( 'show_play_icon', [ 'label' => __( 'Play Icon', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'condition' => [ 'show_image_overlay' => 'yes', 'image_overlay[url]!' => '', ], ] ); $this->add_control( 'lightbox', [ 'label' => __( 'Lightbox', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'frontend_available' => true, 'label_off' => __( 'Off', 'elementor' ), 'label_on' => __( 'On', 'elementor' ), 'condition' => [ 'show_image_overlay' => 'yes', 'image_overlay[url]!' => '', ], 'separator' => 'before', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_video_style', [ 'label' => __( 'Video', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'aspect_ratio', [ 'label' => __( 'Aspect Ratio', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ '169' => '16:9', '219' => '21:9', '43' => '4:3', '32' => '3:2', '11' => '1:1', '916' => '9:16', ], 'default' => '169', 'prefix_class' => 'elementor-aspect-ratio-', 'frontend_available' => true, ] ); $this->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'css_filters', 'selector' => '{{WRAPPER}} .elementor-wrapper', ] ); $this->add_control( 'play_icon_title', [ 'label' => __( 'Play Icon', 'elementor' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'show_image_overlay' => 'yes', 'show_play_icon' => 'yes', ], 'separator' => 'before', ] ); $this->add_control( 'play_icon_color', [ 'label' => __( 'Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-custom-embed-play i' => 'color: {{VALUE}}', ], 'condition' => [ 'show_image_overlay' => 'yes', 'show_play_icon' => 'yes', ], ] ); $this->add_responsive_control( 'play_icon_size', [ 'label' => __( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 10, 'max' => 300, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-custom-embed-play i' => 'font-size: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'show_image_overlay' => 'yes', 'show_play_icon' => 'yes', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'play_icon_text_shadow', 'selector' => '{{WRAPPER}} .elementor-custom-embed-play i', 'fields_options' => [ 'text_shadow_type' => [ 'label' => _x( 'Shadow', 'Text Shadow Control', 'elementor' ), ], ], 'condition' => [ 'show_image_overlay' => 'yes', 'show_play_icon' => 'yes', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_lightbox_style', [ 'label' => __( 'Lightbox', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_image_overlay' => 'yes', 'image_overlay[url]!' => '', 'lightbox' => 'yes', ], ] ); $this->add_control( 'lightbox_color', [ 'label' => __( 'Background Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '#elementor-lightbox-{{ID}}' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'lightbox_ui_color', [ 'label' => __( 'UI Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'lightbox_ui_color_hover', [ 'label' => __( 'UI Hover Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover' => 'color: {{VALUE}}', ], 'separator' => 'after', ] ); $this->add_control( 'lightbox_video_width', [ 'label' => __( 'Content Width', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'unit' => '%', ], 'range' => [ '%' => [ 'min' => 30, ], ], 'selectors' => [ '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'lightbox_content_position', [ 'label' => __( 'Content Position', 'elementor' ), 'type' => Controls_Manager::SELECT, 'frontend_available' => true, 'options' => [ '' => __( 'Center', 'elementor' ), 'top' => __( 'Top', 'elementor' ), ], 'selectors' => [ '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);', ], 'selectors_dictionary' => [ 'top' => 'top: 60px', ], ] ); $this->add_responsive_control( 'lightbox_content_animation', [ 'label' => __( 'Entrance Animation', 'elementor' ), 'type' => Controls_Manager::ANIMATION, 'frontend_available' => true, ] ); $this->end_controls_section(); } /** * Render video widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $video_url = $settings[ $settings['video_type'] . '_url' ]; if ( 'hosted' === $settings['video_type'] ) { $video_url = $this->get_hosted_video_url(); } if ( empty( $video_url ) ) { return; } if ( 'hosted' === $settings['video_type'] ) { ob_start(); $this->render_hosted_video(); $video_html = ob_get_clean(); } else { $embed_params = $this->get_embed_params(); $embed_options = $this->get_embed_options(); $video_html = Embed::get_embed_html( $video_url, $embed_params, $embed_options ); } if ( empty( $video_html ) ) { echo esc_url( $video_url ); return; } $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-wrapper' ); if ( ! $settings['lightbox'] ) { $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-fit-aspect-ratio' ); } $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-open-' . ( $settings['lightbox'] ? 'lightbox' : 'inline' ) ); ?>
get_render_attribute_string( 'video-wrapper' ); ?>> has_image_overlay() ) { $this->add_render_attribute( 'image-overlay', 'class', 'elementor-custom-embed-image-overlay' ); if ( $settings['lightbox'] ) { if ( 'hosted' === $settings['video_type'] ) { $lightbox_url = $video_url; } else { $lightbox_url = Embed::get_embed_url( $video_url, $embed_params, $embed_options ); } $lightbox_options = [ 'type' => 'video', 'videoType' => $settings['video_type'], 'url' => $lightbox_url, 'modalOptions' => [ 'id' => 'elementor-lightbox-' . $this->get_id(), 'entranceAnimation' => $settings['lightbox_content_animation'], 'entranceAnimation_tablet' => $settings['lightbox_content_animation_tablet'], 'entranceAnimation_mobile' => $settings['lightbox_content_animation_mobile'], 'videoAspectRatio' => $settings['aspect_ratio'], ], ]; if ( 'hosted' === $settings['video_type'] ) { $lightbox_options['videoParams'] = $this->get_hosted_params(); } $this->add_render_attribute( 'image-overlay', [ 'data-elementor-open-lightbox' => 'yes', 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ), ] ); if ( Plugin::$instance->editor->is_edit_mode() ) { $this->add_render_attribute( 'image-overlay', [ 'class' => 'elementor-clickable', ] ); } } else { $this->add_render_attribute( 'image-overlay', 'style', 'background-image: url(' . Group_Control_Image_Size::get_attachment_image_src( $settings['image_overlay']['id'], 'image_overlay', $settings ) . ');' ); } ?>
get_render_attribute_string( 'image-overlay' ); ?>>
get_settings_for_display(); if ( 'hosted' !== $settings['video_type'] ) { $url = $settings[ $settings['video_type'] . '_url' ]; } else { $url = $this->get_hosted_video_url(); } echo esc_url( $url ); } /** * Get embed params. * * Retrieve video widget embed parameters. * * @since 1.5.0 * @access public * * @return array Video embed parameters. */ public function get_embed_params() { $settings = $this->get_settings_for_display(); $params = []; if ( $settings['autoplay'] && ! $this->has_image_overlay() ) { $params['autoplay'] = '1'; if ( $settings['play_on_mobile'] ) { $params['playsinline'] = '1'; } } $params_dictionary = []; if ( 'youtube' === $settings['video_type'] ) { $params_dictionary = [ 'loop', 'controls', 'mute', 'rel', 'modestbranding', ]; if ( $settings['loop'] ) { $video_properties = Embed::get_video_properties( $settings['youtube_url'] ); $params['playlist'] = $video_properties['video_id']; } $params['start'] = $settings['start']; $params['end'] = $settings['end']; $params['wmode'] = 'opaque'; } elseif ( 'vimeo' === $settings['video_type'] ) { $params_dictionary = [ 'loop', 'mute' => 'muted', 'vimeo_title' => 'title', 'vimeo_portrait' => 'portrait', 'vimeo_byline' => 'byline', ]; $params['color'] = str_replace( '#', '', $settings['color'] ); $params['autopause'] = '0'; } elseif ( 'dailymotion' === $settings['video_type'] ) { $params_dictionary = [ 'controls', 'mute', 'showinfo' => 'ui-start-screen-info', 'logo' => 'ui-logo', ]; $params['ui-highlight'] = str_replace( '#', '', $settings['color'] ); $params['start'] = $settings['start']; $params['endscreen-enable'] = '0'; } foreach ( $params_dictionary as $key => $param_name ) { $setting_name = $param_name; if ( is_string( $key ) ) { $setting_name = $key; } $setting_value = $settings[ $setting_name ] ? '1' : '0'; $params[ $param_name ] = $setting_value; } return $params; } /** * Whether the video widget has an overlay image or not. * * Used to determine whether an overlay image was set for the video. * * @since 1.0.0 * @access protected * * @return bool Whether an image overlay was set for the video. */ protected function has_image_overlay() { $settings = $this->get_settings_for_display(); return ! empty( $settings['image_overlay']['url'] ) && 'yes' === $settings['show_image_overlay']; } /** * @since 2.1.0 * @access private */ private function get_embed_options() { $settings = $this->get_settings_for_display(); $embed_options = []; if ( 'youtube' === $settings['video_type'] ) { $embed_options['privacy'] = $settings['yt_privacy']; } elseif ( 'vimeo' === $settings['video_type'] ) { $embed_options['start'] = $settings['start']; } $embed_options['lazy_load'] = ! empty( $settings['lazy_load'] ); return $embed_options; } /** * @since 2.1.0 * @access private */ private function get_hosted_params() { $settings = $this->get_settings_for_display(); $video_params = []; foreach ( [ 'autoplay', 'loop', 'controls' ] as $option_name ) { if ( $settings[ $option_name ] ) { $video_params[ $option_name ] = ''; } } if ( $settings['mute'] ) { $video_params['muted'] = 'muted'; } if ( $settings['play_on_mobile'] ) { $video_params['playsinline'] = ''; } if ( ! $settings['download_button'] ) { $video_params['controlsList'] = 'nodownload'; } if ( $settings['poster']['url'] ) { $video_params['poster'] = $settings['poster']['url']; } return $video_params; } /** * @param bool $from_media * * @return string * @since 2.1.0 * @access private */ private function get_hosted_video_url() { $settings = $this->get_settings_for_display(); if ( ! empty( $settings['insert_url'] ) ) { $video_url = $settings['external_url']['url']; } else { $video_url = $settings['hosted_url']['url']; } if ( empty( $video_url ) ) { return ''; } if ( $settings['start'] || $settings['end'] ) { $video_url .= '#t='; } if ( $settings['start'] ) { $video_url .= $settings['start']; } if ( $settings['end'] ) { $video_url .= ',' . $settings['end']; } return $video_url; } /** * * @since 2.1.0 * @access private */ private function render_hosted_video() { $video_url = $this->get_hosted_video_url(); if ( empty( $video_url ) ) { return; } $video_params = $this->get_hosted_params(); ?> start_controls_section( 'section_testimonial', [ 'label' => __( 'Testimonial', 'elementor' ), ] ); $this->add_control( 'testimonial_content', [ 'label' => __( 'Content', 'elementor' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'rows' => '10', 'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ), ] ); $this->add_control( 'testimonial_image', [ 'label' => __( 'Choose Image', 'elementor' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'testimonial_image', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `testimonial_image_size` and `testimonial_image_custom_dimension`. 'default' => 'full', 'separator' => 'none', ] ); $this->add_control( 'testimonial_name', [ 'label' => __( 'Name', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => 'John Doe', ] ); $this->add_control( 'testimonial_job', [ 'label' => __( 'Title', 'elementor' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => 'Designer', ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'elementor' ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'https://your-link.com', 'elementor' ), ] ); $this->add_control( 'testimonial_image_position', [ 'label' => __( 'Image Position', 'elementor' ), 'type' => Controls_Manager::SELECT, 'default' => 'aside', 'options' => [ 'aside' => __( 'Aside', 'elementor' ), 'top' => __( 'Top', 'elementor' ), ], 'condition' => [ 'testimonial_image[url]!' => '', ], 'separator' => 'before', 'style_transfer' => true, ] ); $this->add_control( 'testimonial_alignment', [ 'label' => __( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'center', 'options' => [ 'left' => [ 'title' => __( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => __( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => __( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], ], 'style_transfer' => true, ] ); $this->add_control( 'view', [ 'label' => __( 'View', 'elementor' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'traditional', ] ); $this->end_controls_section(); // Content. $this->start_controls_section( 'section_style_testimonial_content', [ 'label' => __( 'Content', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'content_content_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_3, ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-testimonial-content' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} .elementor-testimonial-content', ] ); $this->end_controls_section(); // Image. $this->start_controls_section( 'section_style_testimonial_image', [ 'label' => __( 'Image', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'testimonial_image[url]!' => '', ], ] ); $this->add_control( 'image_size', [ 'label' => __( 'Image Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 20, 'max' => 200, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial-wrapper .elementor-testimonial-image img' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border', 'selector' => '{{WRAPPER}} .elementor-testimonial-wrapper .elementor-testimonial-image img', 'separator' => 'before', ] ); $this->add_control( 'image_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .elementor-testimonial-wrapper .elementor-testimonial-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Name. $this->start_controls_section( 'section_style_testimonial_name', [ 'label' => __( 'Name', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'name_text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_1, ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-testimonial-name' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'name_typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .elementor-testimonial-name', ] ); $this->end_controls_section(); // Job. $this->start_controls_section( 'section_style_testimonial_job', [ 'label' => __( 'Title', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'job_text_color', [ 'label' => __( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Schemes\Color::get_type(), 'value' => Schemes\Color::COLOR_2, ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-testimonial-job' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'job_typography', 'scheme' => Schemes\Typography::TYPOGRAPHY_2, 'selector' => '{{WRAPPER}} .elementor-testimonial-job', ] ); $this->end_controls_section(); } /** * Render testimonial widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $this->add_render_attribute( 'wrapper', 'class', 'elementor-testimonial-wrapper' ); if ( $settings['testimonial_alignment'] ) { $this->add_render_attribute( 'wrapper', 'class', 'elementor-testimonial-text-align-' . $settings['testimonial_alignment'] ); } $this->add_render_attribute( 'meta', 'class', 'elementor-testimonial-meta' ); if ( $settings['testimonial_image']['url'] ) { $this->add_render_attribute( 'meta', 'class', 'elementor-has-image' ); } if ( $settings['testimonial_image_position'] ) { $this->add_render_attribute( 'meta', 'class', 'elementor-testimonial-image-position-' . $settings['testimonial_image_position'] ); } $has_content = ! ! $settings['testimonial_content']; $has_image = ! ! $settings['testimonial_image']['url']; $has_name = ! ! $settings['testimonial_name']; $has_job = ! ! $settings['testimonial_job']; if ( ! $has_content && ! $has_image && ! $has_name && ! $has_job ) { return; } if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'link', $settings['link'] ); } ?>
get_render_attribute_string( 'wrapper' ); ?>> add_render_attribute( 'testimonial_content', 'class', 'elementor-testimonial-content' ); $this->add_inline_editing_attributes( 'testimonial_content' ); ?>
get_render_attribute_string( 'testimonial_content' ); ?>>
get_render_attribute_string( 'meta' ); ?>>
get_render_attribute_string( 'link' ) . '>' . $image_html . ''; endif; echo $image_html; ?>
add_render_attribute( 'testimonial_name', 'class', 'elementor-testimonial-name' ); $this->add_inline_editing_attributes( 'testimonial_name', 'none' ); $testimonial_name_html = $settings['testimonial_name']; if ( ! empty( $settings['link']['url'] ) ) : ?> get_render_attribute_string( 'testimonial_name' ) . ' ' . $this->get_render_attribute_string( 'link' ); ?>>
get_render_attribute_string( 'testimonial_name' ); ?>>
add_render_attribute( 'testimonial_job', 'class', 'elementor-testimonial-job' ); $this->add_inline_editing_attributes( 'testimonial_job', 'none' ); $testimonial_job_html = $settings['testimonial_job']; if ( ! empty( $settings['link']['url'] ) ) : ?> get_render_attribute_string( 'testimonial_job' ) . ' ' . $this->get_render_attribute_string( 'link' ); ?>>
get_render_attribute_string( 'testimonial_job' ); ?>>
<# var image = { id: settings.testimonial_image.id, url: settings.testimonial_image.url, size: settings.testimonial_image_size, dimension: settings.testimonial_image_custom_dimension, model: view.getEditModel() }; var imageUrl = false, hasImage = ''; if ( '' !== settings.testimonial_image.url ) { imageUrl = elementor.imagesManager.getImageUrl( image ); hasImage = ' elementor-has-image'; var imageHtml = 'testimonial'; if ( settings.link.url ) { imageHtml = '' + imageHtml + ''; } } var testimonial_alignment = settings.testimonial_alignment ? ' elementor-testimonial-text-align-' + settings.testimonial_alignment : ''; var testimonial_image_position = settings.testimonial_image_position ? ' elementor-testimonial-image-position-' + settings.testimonial_image_position : ''; #>
<# if ( '' !== settings.testimonial_content ) { view.addRenderAttribute( 'testimonial_content', 'class', 'elementor-testimonial-content' ); view.addInlineEditingAttributes( 'testimonial_content' ); #>
{{{ settings.testimonial_content }}}
<# } #>
<# if ( imageUrl ) { #>
{{{ imageHtml }}}
<# } #>
render_testimonial_description(); ?>
<# if ( '' !== settings.testimonial_name ) { view.addRenderAttribute( 'testimonial_name', 'class', 'elementor-testimonial-name' ); view.addInlineEditingAttributes( 'testimonial_name', 'none' ); if ( settings.link.url ) { #> {{{ settings.testimonial_name }}} <# } else { #>
{{{ settings.testimonial_name }}}
<# } } if ( '' !== settings.testimonial_job ) { view.addRenderAttribute( 'testimonial_job', 'class', 'elementor-testimonial-job' ); view.addInlineEditingAttributes( 'testimonial_job', 'none' ); if ( settings.link.url ) { #> {{{ settings.testimonial_job }}} <# } else { #>
{{{ settings.testimonial_job }}}
<# } } #> pr r class-wp-widget-search.phpnuW+APK,v\.. class-wp-widget-media-image.phpnuW+APK,v\#Bkvv!9class-wp-widget-media-gallery.phpnuW+APK,v\%_p/ / Vclass-wp-widget-calendar.phpnuW+APK,v\z<<bclass-wp-widget-links.phpnuW+APK,v\eTR R ~class-wp-widget-meta.phpnuW+APK,v\j*#;class-wp-widget-recent-comments.phpnuW+APK,v\|class-wp-widget-categories.phpnuW+APK,v\YV: class-wp-widget-media-video.phpnuW+APK,v\n/n/class-wp-widget-custom-html.phpnuW+APK,v\class-wp-widget-media-audio.phpnuW+APK,v\ 'class-wp-widget-rss.phpnuW+APK,v\66 7class-wp-widget-media.phpnuW+APK,v\[Dnclass-wp-widget-tag-cloud.phpnuW+APK,v\Guu bclass-wp-widget-recent-posts.phpnuW+APK,v\rO'class-wp-widget-archives.phpnuW+APK,v\{class-wp-nav-menu-widget.phpnuW+APK,v\OxWclass-wp-widget-pages.phpnuW+APK,v\5('SS6class-wp-widget-text.phpnuW+APKz8\S/media-audio-widget.min.jsnuW+APKz8\E 5media-video-widget.min.jsnuW+APKz8\8v\\@media-image-widget.jsnuW+APKz8\Vd1Vmedia-image-widget.min.jsnuW+APKz8\Zv^media-gallery-widget.min.jsnuW+APKz8\2kUmtext-widgets.min.jsnuW+APKz8\^llmedia-video-widget.jsnuW+APKz8\'rFFtext-widgets.jsnuW+APKz8\E1media-audio-widget.jsnuW+APKz8\^media-widgets.jsnuW+APKz8\JIr(r(media-gallery-widget.jsnuW+APKz8\pZ77dmedia-widgets.min.jsnuW+APKz8\+ -~custom-html-widgets.min.jsnuW+APKz8\'H==custom-html-widgets.jsnuW+APKh=\Z  &Sclass-wc-widget-top-rated-products.phpnuW+APKh=\DD A]class-wc-widget-price-filter.phpnuW+APKh=\Im m "|class-wc-widget-recent-reviews.phpnuW+APKh=\!\class-wc-widget-cart.phpnuW+APKh=\"f_ _ #_class-wc-widget-recently-viewed.phpnuW+APKh=\!8'class-wc-widget-layered-nav-filters.phpnuW+APKh=\_[[!2class-wc-widget-rating-filter.phpnuW+APKh=\D  %class-wc-widget-product-tag-cloud.phpnuW+APKh=\]b]]<class-wc-widget-products.phpnuW+APKh=\:,,&class-wc-widget-product-categories.phpnuW+APKh=\~j88gclass-wc-widget-layered-nav.phpnuW+APKh=\%7!!"7class-wc-widget-product-search.phpnuW+APKYe\N+BB "<common.phpnuW+APKYe\V== ,image-box.phpnuW+APKYe\>-CC accordion.phpnuW+APKYe\ G L Limage-carousel.phpnuW+APKYe\"7Nnn Maudio.phpnuW+APKYe\~DD itoggle.phpnuW+APKYe\ ` alert.phpnuW+APKYe\h ycounter.phpnuW+APKYe\e)-)-star-rating.phpnuW+APKYe\ŸYB"B"image-gallery.phpnuW+APKYe\e66 ?button.phpnuW+APKYe\0r,r,xvicon.phpnuW+APKYe\MZFF "icon-box.phpnuW+APKYe\/Q11  heading.phpnuW+APKYe\JvKn n wsidebar.phpnuW+APKYe\ '6'' text-editor.phpnuW+APKYe\1 g:read-more.phpnuW+APKYe\ 9'AA *Eimage.phpnuW+APKYe\Mo% % ]spacer.phpnuW+APKYe\K%html.phpnuW+APKYe\H7Jgoogle-maps.phpnuW+APKYe\L%% progress.phpnuW+APKYe\ 6~8~8social-icons.phpnuW+APKYe\CC d icon-list.phpnuW+APKYe\J{.--HT tabs.phpnuW+APKYe\́yy  divider.phpnuW+APKYe\eB B  menu-anchor.phpnuW+APKYe\"  wordpress.phpnuW+APKYe\/Q S% shortcode.phpnuW+APKYe\(bb 1 video.phpnuW+APKYe\͐<< testimonial.phpnuW+APKLLT