← All changes
|
app/Elementor/Widgets/Controls/MetaSettings.php
+109
-110
2.1.11
→
1.1.4
View file →
| @@ -1,110 +1,109 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Main MetaSettings class. | |
| 4 | - * | |
| 5 | - * @package RadiusTheme\SB | |
| 6 | - */ | |
| 7 | - | |
| 8 | -namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | - | |
| 10 | -use Elementor\Controls_Manager; | |
| 11 | -use RadiusTheme\SB\Elementor\Helper\ControlHelper; | |
| 12 | - | |
| 13 | -// Do not allow directly accessing this file. | |
| 14 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 15 | - exit( 'This script cannot be accessed directly.' ); | |
| 16 | -} | |
| 17 | - | |
| 18 | -/** | |
| 19 | - * MetaSettings class | |
| 20 | - */ | |
| 21 | -class MetaSettings { | |
| 22 | - /** | |
| 23 | - * Widget Field | |
| 24 | - * | |
| 25 | - * @return array | |
| 26 | - */ | |
| 27 | - public static function widget_fields( $widget ) { | |
| 28 | - $alignment = ControlHelper::flex_alignment(); | |
| 29 | - $fields = [ | |
| 30 | - 'meta_settings_content' => [ | |
| 31 | - 'mode' => 'section_start', | |
| 32 | - 'label' => esc_html__( 'Settings', 'shopbuilder' ), | |
| 33 | - 'tab' => 'content', | |
| 34 | - ], | |
| 35 | - | |
| 36 | - 'meta_layout' => [ | |
| 37 | - 'label' => esc_html__( 'Layout', 'shopbuilder' ), | |
| 38 | - 'type' => 'choose', | |
| 39 | - 'default' => 'column', | |
| 40 | - 'options' => [ | |
| 41 | - 'row' => [ | |
| 42 | - 'title' => esc_html__( 'Inline', 'shopbuilder' ), | |
| 43 | - 'icon' => 'eicon-ellipsis-h', | |
| 44 | - ], | |
| 45 | - 'column' => [ | |
| 46 | - 'title' => esc_html__( 'New Line', 'shopbuilder' ), | |
| 47 | - 'icon' => 'eicon-editor-list-ul', | |
| 48 | - ], | |
| 49 | - ], | |
| 50 | - | |
| 51 | - 'prefix_class' => 'shopbuilder-layout-', | |
| 52 | - 'separator' => 'default', | |
| 53 | - 'selectors' => [ | |
| 54 | - $widget->selectors['meta_layout'] => 'gap: 5px;flex-direction: {{VALUE}};', | |
| 55 | - ], | |
| 56 | - ], | |
| 57 | - | |
| 58 | - 'align' => [ | |
| 59 | - 'mode' => 'responsive', | |
| 60 | - 'label' => esc_html__( 'Alignment', 'shopbuilder' ), | |
| 61 | - 'type' => 'choose', | |
| 62 | - 'options' => $alignment, | |
| 63 | - 'default' => '', | |
| 64 | - 'selectors' => [ | |
| 65 | - $widget->selectors['align'] => 'align-items: {{VALUE}};justify-content: {{VALUE}};', | |
| 66 | - ], | |
| 67 | - ], | |
| 68 | - 'gap' => [ | |
| 69 | - 'label' => esc_html__( 'Meta Gap (px)', 'shopbuilder' ), | |
| 70 | - 'type' => 'slider', | |
| 71 | - 'mode' => 'responsive', | |
| 72 | - 'size_units' => [ 'px' ], | |
| 73 | - 'range' => [ | |
| 74 | - 'px' => [ | |
| 75 | - 'min' => 0, | |
| 76 | - 'max' => 100, | |
| 77 | - 'step' => 1, | |
| 78 | - ], | |
| 79 | - ], | |
| 80 | - 'selectors' => [ | |
| 81 | - $widget->selectors['gap'] => 'gap: {{SIZE}}{{UNIT}}', | |
| 82 | - ], | |
| 83 | - ], | |
| 84 | - 'show_sku' => [ | |
| 85 | - 'label' => esc_html__( 'Show SKU?', 'shopbuilder' ), | |
| 86 | - 'type' => 'switch', | |
| 87 | - 'description' => esc_html__( 'Switch on to show SKU.', 'shopbuilder' ), | |
| 88 | - 'default' => 'yes', | |
| 89 | - ], | |
| 90 | - 'show_cat' => [ | |
| 91 | - 'label' => esc_html__( 'Show Category?', 'shopbuilder' ), | |
| 92 | - 'type' => 'switch', | |
| 93 | - 'description' => esc_html__( 'Switch on to show category.', 'shopbuilder' ), | |
| 94 | - 'default' => 'yes', | |
| 95 | - ], | |
| 96 | - 'show_tag' => [ | |
| 97 | - 'label' => esc_html__( 'Show Tag?', 'shopbuilder' ), | |
| 98 | - 'type' => 'switch', | |
| 99 | - 'description' => esc_html__( 'Switch on to show tag.', 'shopbuilder' ), | |
| 100 | - 'default' => 'yes', | |
| 101 | - ], | |
| 102 | - 'meta_settings_content_end' => [ | |
| 103 | - 'mode' => 'section_end', | |
| 104 | - ], | |
| 105 | - ]; | |
| 106 | - return $fields; | |
| 107 | - } | |
| 108 | - | |
| 109 | - | |
| 110 | -} | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Main MetaSettings class. | |
| 4 | + * | |
| 5 | + * @package RadiusTheme\SB | |
| 6 | + */ | |
| 7 | + | |
| 8 | +namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | + | |
| 10 | +use Elementor\Controls_Manager; | |
| 11 | +use RadiusTheme\SB\Elementor\Helper\ControlHelper; | |
| 12 | + | |
| 13 | +// Do not allow directly accessing this file. | |
| 14 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 15 | + exit( 'This script cannot be accessed directly.' ); | |
| 16 | +} | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * MetaSettings class | |
| 20 | + */ | |
| 21 | +class MetaSettings { | |
| 22 | + /** | |
| 23 | + * Widget Field | |
| 24 | + * | |
| 25 | + * @return array | |
| 26 | + */ | |
| 27 | + public static function widget_fields( $widget ) { | |
| 28 | + $alignment = ControlHelper::flex_alignment(); | |
| 29 | + $fields = [ | |
| 30 | + 'meta_settings_content' => [ | |
| 31 | + 'mode' => 'section_start', | |
| 32 | + 'label' => esc_html__( 'Settings', 'shopbuilder' ), | |
| 33 | + 'tab' => 'content', | |
| 34 | + ], | |
| 35 | + | |
| 36 | + 'meta_layout' => [ | |
| 37 | + 'label' => esc_html__( 'Layout', 'shopbuilder' ), | |
| 38 | + 'type' => 'choose', | |
| 39 | + 'default' => 'column', | |
| 40 | + 'options' => [ | |
| 41 | + 'row' => [ | |
| 42 | + 'title' => esc_html__( 'Inline', 'shopbuilder' ), | |
| 43 | + 'icon' => 'eicon-ellipsis-h', | |
| 44 | + ], | |
| 45 | + 'column' => [ | |
| 46 | + 'title' => esc_html__( 'New Line', 'shopbuilder' ), | |
| 47 | + 'icon' => 'eicon-editor-list-ul', | |
| 48 | + ], | |
| 49 | + ], | |
| 50 | + | |
| 51 | + 'prefix_class' => 'shopbuilder-layout-', | |
| 52 | + 'separator' => 'default', | |
| 53 | + 'selectors' => [ | |
| 54 | + $widget->selectors['meta_layout'] => 'flex-direction: {{VALUE}};display: flex;flex-wrap: wrap;', | |
| 55 | + ], | |
| 56 | + ], | |
| 57 | + | |
| 58 | + 'align' => [ | |
| 59 | + 'mode' => 'responsive', | |
| 60 | + 'label' => esc_html__( 'Alignment', 'shopbuilder' ), | |
| 61 | + 'type' => 'choose', | |
| 62 | + 'options' => $alignment, | |
| 63 | + 'default' => '', | |
| 64 | + 'selectors' => [ | |
| 65 | + $widget->selectors['align'] => 'align-items: {{VALUE}};justify-content: {{VALUE}};', | |
| 66 | + ], | |
| 67 | + ], | |
| 68 | + 'gap' => [ | |
| 69 | + 'label' => esc_html__( 'Meta Gap (px)', 'shopbuilder' ), | |
| 70 | + 'type' => 'slider', | |
| 71 | + 'size_units' => [ 'px' ], | |
| 72 | + 'range' => [ | |
| 73 | + 'px' => [ | |
| 74 | + 'min' => 0, | |
| 75 | + 'max' => 100, | |
| 76 | + 'step' => 1, | |
| 77 | + ], | |
| 78 | + ], | |
| 79 | + 'selectors' => [ | |
| 80 | + $widget->selectors['gap'] => 'gap: {{SIZE}}{{UNIT}}', | |
| 81 | + ], | |
| 82 | + ], | |
| 83 | + 'show_sku' => [ | |
| 84 | + 'label' => esc_html__( 'Show SKU?', 'shopbuilder' ), | |
| 85 | + 'type' => 'switch', | |
| 86 | + 'description' => esc_html__( 'Switch on to show SKU.', 'shopbuilder' ), | |
| 87 | + 'default' => 'yes', | |
| 88 | + ], | |
| 89 | + 'show_cat' => [ | |
| 90 | + 'label' => esc_html__( 'Show Category?', 'shopbuilder' ), | |
| 91 | + 'type' => 'switch', | |
| 92 | + 'description' => esc_html__( 'Switch on to show category.', 'shopbuilder' ), | |
| 93 | + 'default' => 'yes', | |
| 94 | + ], | |
| 95 | + 'show_tag' => [ | |
| 96 | + 'label' => esc_html__( 'Show Tag?', 'shopbuilder' ), | |
| 97 | + 'type' => 'switch', | |
| 98 | + 'description' => esc_html__( 'Switch on to show tag.', 'shopbuilder' ), | |
| 99 | + 'default' => 'yes', | |
| 100 | + ], | |
| 101 | + 'meta_settings_content_end' => [ | |
| 102 | + 'mode' => 'section_end', | |
| 103 | + ], | |
| 104 | + ]; | |
| 105 | + return $fields; | |
| 106 | + } | |
| 107 | + | |
| 108 | + | |
| 109 | +} | |