| @@ -1,195 +1,407 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 2 | + | |
| 3 | 3 | namespace UltimateStoreKit\Modules\FeaturedBox\Widgets; |
| 4 | 4 | |
| 5 | -use UltimateStoreKit\Base\Module_Base; | |
| 6 | -use Elementor\Group_Control_Css_Filter; | |
| 7 | -use Elementor\this; | |
| 8 | 5 | use Elementor\Controls_Manager; |
| 6 | +use Elementor\Group_Control_Background; | |
| 7 | +use Elementor\Group_Control_Border; | |
| 9 | 8 | use Elementor\Group_Control_Box_Shadow; |
| 10 | 9 | use Elementor\Group_Control_Image_Size; |
| 11 | 10 | use Elementor\Group_Control_Typography; |
| 12 | -use Elementor\Group_Control_Text_Shadow; | |
| 13 | -use Elementor\Group_Control_Background; | |
| 14 | -use Elementor\Group_Control_Border; | |
| 15 | -use Elementor\Icons_Manager; | |
| 16 | -use Elementor\Utils; | |
| 11 | +use UltimateStoreKit\Classes\Utils; | |
| 12 | +use UltimateStoreKit\Base\Module_Base; | |
| 17 | 13 | |
| 18 | -if (! defined('ABSPATH')) { | |
| 14 | +if (!defined('ABSPATH')) { | |
| 19 | 15 | exit; |
| 20 | 16 | } // Exit if accessed directly |
| 21 | 17 | |
| 22 | -class Featured_Box extends Module_Base | |
| 23 | -{ | |
| 24 | - | |
| 25 | - public function get_name() | |
| 26 | - { | |
| 18 | +// phpcs:disable WordPressVIPMinimum.Performance.WPQueryParams -- WordPressVIPMinimum targets the VIP platform, not the plugin directory. These exclusionary parameters come from a widget's own "exclude" control: the list is whatever the site owner picked in Elementor, applied to a bounded result set, not an unbounded catalogue scan. | |
| 19 | + | |
| 20 | +class Featured_Box extends Module_Base { | |
| 21 | + | |
| 22 | + public function get_name() { | |
| 27 | 23 | return 'usk-featured-box'; |
| 28 | 24 | } |
| 29 | - | |
| 30 | - public function get_title() | |
| 31 | - { | |
| 32 | - return esc_html__('Featured Box', 'ultimate-store-kit'); | |
| 25 | + | |
| 26 | + public function get_title() { | |
| 27 | + return esc_html__('Featured Box', 'ultimate-store-kit'); | |
| 33 | 28 | } |
| 34 | - | |
| 35 | - public function get_icon() | |
| 36 | - { | |
| 29 | + | |
| 30 | + public function get_icon() { | |
| 37 | 31 | return 'usk-widget-icon usk-icon-featured-box'; |
| 38 | 32 | } |
| 39 | 33 | |
| 40 | - public function get_categories() | |
| 41 | - { | |
| 34 | + public function get_categories() { | |
| 42 | 35 | return ['ultimate-store-kit']; |
| 43 | 36 | } |
| 44 | - | |
| 45 | - public function get_keywords() | |
| 46 | - { | |
| 47 | - return [ 'services', 'list', 'featured', 'box', 'info' ]; | |
| 37 | + | |
| 38 | + public function get_keywords() { | |
| 39 | + return ['services', 'list', 'featured', 'box', 'info', 'featured box']; | |
| 48 | 40 | } |
| 49 | - | |
| 50 | - public function get_style_depends() | |
| 51 | - { | |
| 41 | + | |
| 42 | + public function get_style_depends() { | |
| 52 | 43 | if ($this->usk_is_edit_mode()) { |
| 53 | - return [ 'usk-styles' ]; | |
| 44 | + return ['usk-styles']; | |
| 54 | 45 | } else { |
| 55 | - return [ 'usk-featured-box' ]; | |
| 46 | + return ['usk-featured-box']; | |
| 56 | 47 | } |
| 57 | 48 | } |
| 58 | - | |
| 49 | + | |
| 59 | 50 | // public function get_custom_help_url() { |
| 60 | 51 | // return 'https://youtu.be/a_wJL950Kz4'; |
| 61 | 52 | // } |
| 62 | - | |
| 63 | - protected function register_controls() | |
| 64 | - { | |
| 65 | - | |
| 53 | + | |
| 54 | + public function has_widget_inner_wrapper(): bool { | |
| 55 | + return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 56 | + } | |
| 57 | + protected function register_controls() { | |
| 58 | + | |
| 66 | 59 | $this->start_controls_section( |
| 67 | 60 | 'section_layout', |
| 68 | 61 | [ |
| 69 | 62 | 'label' => __('Layout', 'ultimate-store-kit'), |
| 70 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 63 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 71 | 64 | ] |
| 72 | 65 | ); |
| 73 | 66 | |
| 67 | + $this->start_controls_tabs('tabs_layout'); | |
| 68 | + $this->start_controls_tab( | |
| 69 | + 'tab_content', | |
| 70 | + [ | |
| 71 | + 'label' => __('Content', 'ultimate-store-kit'), | |
| 72 | + ] | |
| 73 | + ); | |
| 74 | + | |
| 74 | 75 | $this->add_control( |
| 75 | 76 | 'title', |
| 76 | 77 | [ |
| 77 | - 'label' => __('Title', 'ultimate-store-kit'), | |
| 78 | - 'type' => Controls_Manager::TEXT, | |
| 79 | - 'dynamic' => [ | |
| 78 | + 'label' => __('Title', 'ultimate-store-kit'), | |
| 79 | + 'type' => Controls_Manager::TEXT, | |
| 80 | + 'dynamic' => [ | |
| 80 | 81 | 'active' => true, |
| 81 | 82 | ], |
| 82 | - 'default' => esc_html__('New Featured Box', 'ultimate-store-kit'), | |
| 83 | + 'default' => esc_html__('New Featured Box', 'ultimate-store-kit'), | |
| 83 | 84 | 'placeholder' => __('Enter your title', 'ultimate-store-kit'), |
| 84 | 85 | 'label_block' => true, |
| 85 | 86 | 'condition' => [ |
| 86 | 87 | 'show_title' => 'yes', |
| 87 | - ] | |
| 88 | + ], | |
| 88 | 89 | ] |
| 89 | 90 | ); |
| 90 | 91 | |
| 91 | 92 | $this->add_control( |
| 92 | - 'title_link', | |
| 93 | + 'meta', | |
| 93 | 94 | [ |
| 94 | - 'label' => esc_html__('Title Link', 'ultimate-store-kit'), | |
| 95 | - 'type' => Controls_Manager::URL, | |
| 96 | - 'dynamic' => [ 'active' => true ], | |
| 97 | - 'placeholder' => 'http://your-link.com', | |
| 95 | + 'label' => esc_html__('Meta Text', 'ultimate-store-kit'), | |
| 96 | + 'type' => Controls_Manager::TEXT, | |
| 97 | + 'label_block' => true, | |
| 98 | + 'dynamic' => ['active' => true], | |
| 99 | + 'default' => esc_html__('Monthly Discount', 'ultimate-store-kit'), | |
| 98 | 100 | 'condition' => [ |
| 99 | - 'show_title' => 'yes', | |
| 100 | - ] | |
| 101 | + 'show_meta' => 'yes', | |
| 102 | + ], | |
| 101 | 103 | ] |
| 102 | 104 | ); |
| 103 | 105 | |
| 104 | 106 | $this->add_control( |
| 105 | - 'text', | |
| 107 | + 'readmore_text', | |
| 106 | 108 | [ |
| 107 | - 'label' => esc_html__('Text', 'ultimate-store-kit'), | |
| 108 | - 'type' => Controls_Manager::WYSIWYG, | |
| 109 | + 'label' => esc_html__('Button Text', 'ultimate-store-kit'), | |
| 110 | + 'type' => Controls_Manager::TEXT, | |
| 111 | + 'default' => esc_html__('Shop Now', 'ultimate-store-kit'), | |
| 109 | 112 | 'label_block' => true, |
| 110 | - 'dynamic' => ['active' => true], | |
| 111 | - 'default' => esc_html__('Don\'t miss the last opportunity.', 'ultimate-store-kit'), | |
| 113 | + 'dynamic' => ['active' => true], | |
| 112 | 114 | 'condition' => [ |
| 113 | - 'show_text' => 'yes', | |
| 115 | + 'show_readmore' => 'yes', | |
| 114 | 116 | ], |
| 117 | + ] | |
| 118 | + ); | |
| 119 | + | |
| 120 | + $this->add_control( | |
| 121 | + 'readmore_link', | |
| 122 | + [ | |
| 123 | + 'label' => esc_html__('Button Link', 'ultimate-store-kit'), | |
| 124 | + 'type' => Controls_Manager::URL, | |
| 125 | + 'dynamic' => ['active' => true], | |
| 126 | + 'placeholder' => 'http://your-link.com', | |
| 127 | + 'default' => [ | |
| 128 | + 'url' => '#', | |
| 129 | + ], | |
| 130 | + 'condition' => [ | |
| 131 | + 'show_readmore' => 'yes', | |
| 132 | + ], | |
| 133 | + ] | |
| 134 | + ); | |
| 135 | + $this->add_responsive_control( | |
| 136 | + 'image', | |
| 137 | + [ | |
| 138 | + 'label' => __('Image', 'ultimate-store-kit'), | |
| 139 | + 'type' => Controls_Manager::MEDIA, | |
| 140 | + 'dynamic' => [ 'active' => true ], | |
| 141 | + 'default' => [ | |
| 142 | + 'url' => \Elementor\Utils::get_placeholder_image_src(), | |
| 143 | + ], | |
| 144 | + 'selectors' => [ | |
| 145 | + '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-image: url("{{URL}}");', | |
| 146 | + ], | |
| 147 | + 'has_sizes' => true, | |
| 148 | + 'render_type' => 'template', | |
| 149 | + ] | |
| 150 | + ); | |
| 151 | + $this->add_responsive_control( | |
| 152 | + 'position', | |
| 153 | + [ | |
| 154 | + 'label' => esc_html__( 'Position', 'ultimate-store-kit' ), | |
| 155 | + 'type' => Controls_Manager::SELECT, | |
| 156 | + 'default' => '', | |
| 115 | 157 | 'separator' => 'before', |
| 116 | - // 'rows' => 4 | |
| 158 | + 'options' => [ | |
| 159 | + '' => esc_html__( 'Default', 'ultimate-store-kit' ), | |
| 160 | + 'center center' => esc_html__( 'Center Center', 'ultimate-store-kit' ), | |
| 161 | + 'center left' => esc_html__( 'Center Left', 'ultimate-store-kit' ), | |
| 162 | + 'center right' => esc_html__( 'Center Right', 'ultimate-store-kit' ), | |
| 163 | + 'top center' => esc_html__( 'Top Center', 'ultimate-store-kit' ), | |
| 164 | + 'top left' => esc_html__( 'Top Left', 'ultimate-store-kit' ), | |
| 165 | + 'top right' => esc_html__( 'Top Right', 'ultimate-store-kit' ), | |
| 166 | + 'bottom center' => esc_html__( 'Bottom Center', 'ultimate-store-kit' ), | |
| 167 | + 'bottom left' => esc_html__( 'Bottom Left', 'ultimate-store-kit' ), | |
| 168 | + 'bottom right' => esc_html__( 'Bottom Right', 'ultimate-store-kit' ), | |
| 169 | + 'initial' => esc_html__( 'Custom', 'ultimate-store-kit' ), | |
| 170 | + | |
| 171 | + ], | |
| 172 | + 'selectors' => [ | |
| 173 | + '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-position: {{VALUE}};', | |
| 174 | + ], | |
| 175 | + 'condition' => [ | |
| 176 | + 'image[url]!' => '', | |
| 177 | + ], | |
| 117 | 178 | ] |
| 118 | 179 | ); |
| 119 | 180 | |
| 120 | - $this->add_control( | |
| 121 | - 'meta', | |
| 181 | + $this->add_responsive_control( | |
| 182 | + 'xpos', | |
| 122 | 183 | [ |
| 123 | - 'label' => esc_html__('Meta', 'ultimate-store-kit'), | |
| 124 | - 'type' => Controls_Manager::TEXT, | |
| 125 | - 'label_block' => true, | |
| 126 | - 'dynamic' => ['active' => true], | |
| 127 | - 'default' => esc_html__('Monthly Discount', 'ultimate-store-kit'), | |
| 184 | + 'label' => esc_html__( 'X Position', 'ultimate-store-kit' ), | |
| 185 | + 'type' => Controls_Manager::SLIDER, | |
| 186 | + 'responsive' => true, | |
| 187 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 188 | + 'default' => [ | |
| 189 | + 'size' => 0, | |
| 190 | + ], | |
| 191 | + 'tablet_default' => [ | |
| 192 | + 'size' => 0, | |
| 193 | + ], | |
| 194 | + 'mobile_default' => [ | |
| 195 | + 'size' => 0, | |
| 196 | + ], | |
| 197 | + 'range' => [ | |
| 198 | + 'px' => [ | |
| 199 | + 'min' => -800, | |
| 200 | + 'max' => 800, | |
| 201 | + ], | |
| 202 | + 'em' => [ | |
| 203 | + 'min' => -100, | |
| 204 | + 'max' => 100, | |
| 205 | + ], | |
| 206 | + '%' => [ | |
| 207 | + 'min' => -100, | |
| 208 | + 'max' => 100, | |
| 209 | + ], | |
| 210 | + 'vw' => [ | |
| 211 | + 'min' => -100, | |
| 212 | + 'max' => 100, | |
| 213 | + ], | |
| 214 | + ], | |
| 215 | + 'selectors' => [ | |
| 216 | + '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-position: {{SIZE}}{{UNIT}} {{ypos.SIZE}}{{ypos.UNIT}}', | |
| 217 | + ], | |
| 128 | 218 | 'condition' => [ |
| 129 | - 'show_meta' => 'yes', | |
| 219 | + 'position' => [ 'initial' ], | |
| 220 | + 'image[url]!' => '', | |
| 130 | 221 | ], |
| 222 | + 'required' => true, | |
| 131 | 223 | ] |
| 132 | 224 | ); |
| 225 | + | |
| 226 | + $this->add_responsive_control( | |
| 227 | + 'ypos', | |
| 228 | + [ | |
| 229 | + 'label' => esc_html__( 'Y Position', 'ultimate-store-kit' ), | |
| 230 | + 'type' => Controls_Manager::SLIDER, | |
| 231 | + 'responsive' => true, | |
| 232 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'custom' ], | |
| 233 | + 'default' => [ | |
| 234 | + 'size' => 0, | |
| 235 | + ], | |
| 236 | + 'tablet_default' => [ | |
| 237 | + 'size' => 0, | |
| 238 | + ], | |
| 239 | + 'mobile_default' => [ | |
| 240 | + 'size' => 0, | |
| 241 | + ], | |
| 242 | + 'range' => [ | |
| 243 | + 'px' => [ | |
| 244 | + 'min' => -800, | |
| 245 | + 'max' => 800, | |
| 246 | + ], | |
| 247 | + 'em' => [ | |
| 248 | + 'min' => -100, | |
| 249 | + 'max' => 100, | |
| 250 | + ], | |
| 251 | + '%' => [ | |
| 252 | + 'min' => -100, | |
| 253 | + 'max' => 100, | |
| 254 | + ], | |
| 255 | + 'vh' => [ | |
| 256 | + 'min' => -100, | |
| 257 | + 'max' => 100, | |
| 258 | + ], | |
| 259 | + ], | |
| 260 | + 'selectors' => [ | |
| 261 | + '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-position: {{xpos.SIZE}}{{xpos.UNIT}} {{SIZE}}{{UNIT}}', | |
| 262 | + ], | |
| 263 | + 'condition' => [ | |
| 264 | + 'position' => [ 'initial' ], | |
| 265 | + 'image[url]!' => '', | |
| 266 | + ], | |
| 267 | + 'required' => true, | |
| 268 | + ] | |
| 269 | + ); | |
| 133 | 270 | |
| 134 | - $this->add_control( | |
| 135 | - 'readmore_text', | |
| 271 | + $this->add_responsive_control( | |
| 272 | + 'repeat', | |
| 136 | 273 | [ |
| 137 | - 'label' => esc_html__('Button Text', 'ultimate-store-kit'), | |
| 138 | - 'type' => Controls_Manager::TEXT, | |
| 139 | - 'default' => esc_html__('Shop Now', 'ultimate-store-kit'), | |
| 140 | - 'placeholder' => esc_html__('Button Text', 'ultimate-store-kit'), | |
| 274 | + 'label' => esc_html_x( 'Repeat', 'Background Control', 'ultimate-store-kit' ), | |
| 275 | + 'type' => Controls_Manager::SELECT, | |
| 276 | + 'default' => '', | |
| 277 | + 'options' => [ | |
| 278 | + '' => esc_html__( 'Default', 'ultimate-store-kit' ), | |
| 279 | + 'no-repeat' => esc_html__( 'No-repeat', 'ultimate-store-kit' ), | |
| 280 | + 'repeat' => esc_html__( 'Repeat', 'ultimate-store-kit' ), | |
| 281 | + 'repeat-x' => esc_html__( 'Repeat-x', 'ultimate-store-kit' ), | |
| 282 | + 'repeat-y' => esc_html__( 'Repeat-y', 'ultimate-store-kit' ), | |
| 283 | + ], | |
| 284 | + 'selectors' => [ | |
| 285 | + '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-repeat: {{VALUE}};', | |
| 286 | + ], | |
| 141 | 287 | 'condition' => [ |
| 142 | - 'show_readmore' => 'yes', | |
| 288 | + 'image[url]!' => '', | |
| 143 | 289 | ], |
| 144 | - 'separator' => 'before' | |
| 145 | 290 | ] |
| 146 | 291 | ); |
| 147 | 292 | |
| 293 | + $this->add_responsive_control( | |
| 294 | + 'size', | |
| 295 | + [ | |
| 296 | + 'label' => esc_html__( 'Display Size', 'ultimate-store-kit' ), | |
| 297 | + 'type' => Controls_Manager::SELECT, | |
| 298 | + 'default' => '', | |
| 299 | + 'options' => [ | |
| 300 | + '' => esc_html__( 'Default', 'ultimate-store-kit' ), | |
| 301 | + 'auto' => esc_html__( 'Auto', 'ultimate-store-kit' ), | |
| 302 | + 'cover' => esc_html__( 'Cover', 'ultimate-store-kit' ), | |
| 303 | + 'contain' => esc_html__( 'Contain', 'ultimate-store-kit' ), | |
| 304 | + 'initial' => esc_html__( 'Custom', 'ultimate-store-kit' ), | |
| 305 | + ], | |
| 306 | + 'selectors' => [ | |
| 307 | + '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-size: {{VALUE}};', | |
| 308 | + ], | |
| 309 | + 'condition' => [ | |
| 310 | + 'image[url]!' => '', | |
| 311 | + ], | |
| 312 | + ] | |
| 313 | + ); | |
| 314 | + | |
| 315 | + $this->add_responsive_control( | |
| 316 | + 'bg_width', | |
| 317 | + [ | |
| 318 | + 'label' => esc_html__( 'Width', 'ultimate-store-kit' ), | |
| 319 | + 'type' => Controls_Manager::SLIDER, | |
| 320 | + 'responsive' => true, | |
| 321 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 322 | + 'range' => [ | |
| 323 | + 'px' => [ | |
| 324 | + 'max' => 1000, | |
| 325 | + ], | |
| 326 | + ], | |
| 327 | + 'default' => [ | |
| 328 | + 'size' => 100, | |
| 329 | + 'unit' => '%', | |
| 330 | + ], | |
| 331 | + 'required' => true, | |
| 332 | + 'selectors' => [ | |
| 333 | + '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-size: {{SIZE}}{{UNIT}} auto', | |
| 334 | + | |
| 335 | + ], | |
| 336 | + 'condition' => [ | |
| 337 | + 'size' => [ 'initial' ], | |
| 338 | + 'image[url]!' => '', | |
| 339 | + ], | |
| 340 | + ] | |
| 341 | + ); | |
| 342 | + | |
| 343 | + | |
| 344 | + $this->end_controls_tab(); | |
| 345 | + $this->start_controls_tab( | |
| 346 | + 'tab_optional', | |
| 347 | + [ | |
| 348 | + 'label' => __('Optional', 'ultimate-store-kit'), | |
| 349 | + ] | |
| 350 | + ); | |
| 351 | + | |
| 148 | 352 | $this->add_control( |
| 149 | - 'readmore_link', | |
| 353 | + 'title_link', | |
| 150 | 354 | [ |
| 151 | - 'label' => esc_html__('Link', 'ultimate-store-kit'), | |
| 152 | - 'type' => Controls_Manager::URL, | |
| 153 | - 'dynamic' => [ 'active' => true ], | |
| 355 | + 'label' => esc_html__('Title Link', 'ultimate-store-kit'), | |
| 356 | + 'type' => Controls_Manager::URL, | |
| 357 | + 'dynamic' => ['active' => true], | |
| 154 | 358 | 'placeholder' => 'http://your-link.com', |
| 155 | - 'default' => [ | |
| 156 | - 'url' => '#', | |
| 359 | + 'condition' => [ | |
| 360 | + 'show_title' => 'yes', | |
| 157 | 361 | ], |
| 158 | - 'condition' => [ | |
| 159 | - 'show_readmore' => 'yes', | |
| 160 | - ] | |
| 161 | 362 | ] |
| 162 | 363 | ); |
| 163 | 364 | |
| 164 | 365 | $this->add_control( |
| 165 | - 'image', | |
| 366 | + 'text', | |
| 166 | 367 | [ |
| 167 | - 'label' => __('Image', 'ultimate-store-kit'), | |
| 168 | - 'type' => Controls_Manager::MEDIA, | |
| 169 | - 'default' => [ | |
| 170 | - 'url' => Utils::get_placeholder_image_src(), | |
| 368 | + 'label' => esc_html__('Text', 'ultimate-store-kit'), | |
| 369 | + 'type' => Controls_Manager::WYSIWYG, | |
| 370 | + 'label_block' => true, | |
| 371 | + 'dynamic' => ['active' => true], | |
| 372 | + 'default' => esc_html__('Don\'t miss the last opportunity.', 'ultimate-store-kit'), | |
| 373 | + 'condition' => [ | |
| 374 | + 'show_text' => 'yes', | |
| 171 | 375 | ], |
| 172 | - 'separator' => 'before' | |
| 376 | + 'separator' => 'before', | |
| 173 | 377 | ] |
| 174 | 378 | ); |
| 175 | 379 | |
| 176 | - $this->add_group_control( | |
| 177 | - Group_Control_Image_Size::get_type(), | |
| 380 | + $this->add_control( | |
| 381 | + 'badge_text', | |
| 178 | 382 | [ |
| 179 | - 'name' => 'thumbnail', | |
| 180 | - 'default' => 'medium', | |
| 181 | - 'exclude' => ['custom'] | |
| 383 | + 'label' => esc_html__('Badge Text', 'ultimate-store-kit'), | |
| 384 | + 'type' => Controls_Manager::TEXT, | |
| 385 | + 'dynamic' => ['active' => true], | |
| 386 | + 'default' => esc_html__('New', 'ultimate-store-kit'), | |
| 387 | + 'condition' => [ | |
| 388 | + 'badge' => 'yes', | |
| 389 | + ], | |
| 390 | + 'separator' => 'before', | |
| 182 | 391 | ] |
| 183 | 392 | ); |
| 393 | + | |
| 184 | 394 | |
| 395 | + $this->end_controls_tab(); | |
| 396 | + $this->end_controls_tabs(); | |
| 185 | 397 | $this->end_controls_section(); |
| 186 | 398 | |
| 187 | 399 | $this->start_controls_section( |
| 188 | 400 | 'section_additional_settings', |
| 189 | 401 | [ |
| 190 | - 'label' => __('Additional Settings', 'ultimate-store-kit'), | |
| 191 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 402 | + 'label' => __('Additional Options', 'ultimate-store-kit'), | |
| 403 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 192 | 404 | ] |
| 193 | 405 | ); |
| 194 | 406 | |
| 195 | 407 | $this->add_responsive_control( |
| @@ -194,10 +406,10 @@ | ||
| 194 | 406 | |
| 195 | 407 | $this->add_responsive_control( |
| 196 | 408 | 'box_height', |
| 197 | 409 | [ |
| 198 | - 'label' => esc_html__('Height', 'ultimate-store-kit'), | |
| 199 | - 'type' => Controls_Manager::SLIDER, | |
| 410 | + 'label' => esc_html__('Height', 'ultimate-store-kit'), | |
| 411 | + 'type' => Controls_Manager::SLIDER, | |
| 200 | 412 | 'default' => [ |
| 201 | 413 | 'size' => 300, |
| 202 | 414 | ], |
| 203 | 415 | 'range' => [ |
| @@ -206,9 +418,9 @@ | ||
| 206 | 418 | 'max' => 800, |
| 207 | 419 | ], |
| 208 | 420 | ], |
| 209 | 421 | 'selectors' => [ |
| 210 | - '{{WRAPPER}} .usk-featured-box-item' => 'height: {{SIZE}}{{UNIT}};', | |
| 422 | + '{{WRAPPER}} .usk-featured-box .usk-item' => 'height: {{SIZE}}{{UNIT}};', | |
| 211 | 423 | ], |
| 212 | 424 | ] |
| 213 | 425 | ); |
| 214 | 426 | |
| @@ -214,10 +426,10 @@ | ||
| 214 | 426 | |
| 215 | 427 | $this->add_responsive_control( |
| 216 | 428 | 'content_width', |
| 217 | 429 | [ |
| 218 | - 'label' => esc_html__('Content Width', 'ultimate-store-kit'), | |
| 219 | - 'type' => Controls_Manager::SLIDER, | |
| 430 | + 'label' => esc_html__('Content Width', 'ultimate-store-kit'), | |
| 431 | + 'type' => Controls_Manager::SLIDER, | |
| 220 | 432 | 'default' => [ |
| 221 | 433 | 'size' => 500, |
| 222 | 434 | ], |
| 223 | 435 | 'range' => [ |
| @@ -226,34 +438,34 @@ | ||
| 226 | 438 | 'max' => 1200, |
| 227 | 439 | ], |
| 228 | 440 | ], |
| 229 | 441 | 'selectors' => [ |
| 230 | - '{{WRAPPER}} .usk-featured-box .usk-content' => 'width: {{SIZE}}{{UNIT}};', | |
| 442 | + '{{WRAPPER}} .usk-featured-box .usk-content' => 'max-width: {{SIZE}}{{UNIT}};', | |
| 231 | 443 | ], |
| 232 | 444 | ] |
| 233 | 445 | ); |
| 234 | - | |
| 446 | + | |
| 235 | 447 | $this->add_control( |
| 236 | - 'position', | |
| 448 | + 'content_position', | |
| 237 | 449 | [ |
| 238 | - 'label' => esc_html__('Content Position', 'ultimate-store-kit'), | |
| 239 | - 'type' => Controls_Manager::CHOOSE, | |
| 240 | - 'default' => 'center', | |
| 241 | - 'options' => [ | |
| 242 | - 'top' => [ | |
| 450 | + 'label' => esc_html__('Content Position', 'ultimate-store-kit'), | |
| 451 | + 'type' => Controls_Manager::CHOOSE, | |
| 452 | + 'default' => 'center', | |
| 453 | + 'options' => [ | |
| 454 | + 'top' => [ | |
| 243 | 455 | 'title' => esc_html__('Top', 'ultimate-store-kit'), |
| 244 | - 'icon' => 'eicon-v-align-top', | |
| 456 | + 'icon' => 'eicon-v-align-top', | |
| 245 | 457 | ], |
| 246 | 458 | 'center' => [ |
| 247 | 459 | 'title' => esc_html__('Center', 'ultimate-store-kit'), |
| 248 | - 'icon' => 'eicon-v-align-middle', | |
| 460 | + 'icon' => 'eicon-v-align-middle', | |
| 249 | 461 | ], |
| 250 | - 'bottom' => [ | |
| 462 | + 'bottom' => [ | |
| 251 | 463 | 'title' => esc_html__('Bottom', 'ultimate-store-kit'), |
| 252 | - 'icon' => 'eicon-v-align-bottom', | |
| 464 | + 'icon' => 'eicon-v-align-bottom', | |
| 253 | 465 | ], |
| 254 | 466 | ], |
| 255 | - 'toggle' => false | |
| 467 | + 'toggle' => false, | |
| 256 | 468 | ] |
| 257 | 469 | ); |
| 258 | 470 | |
| 259 | 471 | $this->add_responsive_control( |
| @@ -258,22 +470,22 @@ | ||
| 258 | 470 | |
| 259 | 471 | $this->add_responsive_control( |
| 260 | 472 | 'alignment', |
| 261 | 473 | [ |
| 262 | - 'label' => esc_html__('Alignment', 'ultimate-store-kit'), | |
| 263 | - 'type' => Controls_Manager::CHOOSE, | |
| 264 | - 'options' => [ | |
| 265 | - 'left' => [ | |
| 474 | + 'label' => esc_html__('Alignment', 'ultimate-store-kit'), | |
| 475 | + 'type' => Controls_Manager::CHOOSE, | |
| 476 | + 'options' => [ | |
| 477 | + 'left' => [ | |
| 266 | 478 | 'title' => esc_html__('Left', 'ultimate-store-kit'), |
| 267 | - 'icon' => 'eicon-h-align-left', | |
| 479 | + 'icon' => 'eicon-h-align-left', | |
| 268 | 480 | ], |
| 269 | 481 | 'center' => [ |
| 270 | 482 | 'title' => esc_html__('Center', 'ultimate-store-kit'), |
| 271 | - 'icon' => 'eicon-h-align-center', | |
| 483 | + 'icon' => 'eicon-h-align-center', | |
| 272 | 484 | ], |
| 273 | - 'right' => [ | |
| 485 | + 'right' => [ | |
| 274 | 486 | 'title' => esc_html__('Right', 'ultimate-store-kit'), |
| 275 | - 'icon' => 'eicon-h-align-right', | |
| 487 | + 'icon' => 'eicon-h-align-right', | |
| 276 | 488 | ], |
| 277 | 489 | ], |
| 278 | 490 | 'selectors' => [ |
| 279 | 491 | '{{WRAPPER}} .usk-featured-box .usk-content' => 'text-align: {{VALUE}}', |
| @@ -280,160 +492,13 @@ | ||
| 280 | 492 | ], |
| 281 | 493 | ] |
| 282 | 494 | ); |
| 283 | 495 | |
| 284 | - // $this->add_control( | |
| 285 | - // 'background_image_toggle', | |
| 286 | - // [ | |
| 287 | - // 'label' => __('Background Image Settings', 'ultimate-store-kit'), | |
| 288 | - // 'type' => Controls_Manager::POPOVER_TOGGLE, | |
| 289 | - // 'label_off' => __('None', 'ultimate-store-kit'), | |
| 290 | - // 'label_on' => __('Custom', 'ultimate-store-kit'), | |
| 291 | - // 'return_value' => 'yes', | |
| 292 | - // 'separator' => 'before' | |
| 293 | - // ] | |
| 294 | - // ); | |
| 295 | - | |
| 296 | - // $this->start_popover(); | |
| 297 | - | |
| 298 | - // $this->add_responsive_control( | |
| 299 | - // 'background_image_position', | |
| 300 | - // [ | |
| 301 | - // 'label' => _x( 'Position', 'ultimate-store-kit' ), | |
| 302 | - // 'type' => Controls_Manager::SELECT, | |
| 303 | - // 'default' => '', | |
| 304 | - // 'options' => [ | |
| 305 | - // '' => _x( 'Default', 'ultimate-store-kit' ), | |
| 306 | - // 'center center' => _x( 'Center Center', 'ultimate-store-kit' ), | |
| 307 | - // 'center left' => _x( 'Center Left', 'ultimate-store-kit' ), | |
| 308 | - // 'center right' => _x( 'Center Right', 'ultimate-store-kit' ), | |
| 309 | - // 'top center' => _x( 'Top Center', 'ultimate-store-kit' ), | |
| 310 | - // 'top left' => _x( 'Top Left', 'ultimate-store-kit' ), | |
| 311 | - // 'top right' => _x( 'Top Right', 'ultimate-store-kit' ), | |
| 312 | - // 'bottom center' => _x( 'Bottom Center', 'ultimate-store-kit' ), | |
| 313 | - // 'bottom left' => _x( 'Bottom Left', 'ultimate-store-kit' ), | |
| 314 | - // 'bottom right' => _x( 'Bottom Right', 'ultimate-store-kit' ), | |
| 315 | - // ], | |
| 316 | - // 'selectors' => [ | |
| 317 | - // '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-position: {{VALUE}};', | |
| 318 | - // ], | |
| 319 | - // 'condition' => [ | |
| 320 | - // 'background_image_toggle' => 'yes' | |
| 321 | - // ], | |
| 322 | - // 'render_type' => 'ui', | |
| 323 | - // ] | |
| 324 | - // ); | |
| 325 | - | |
| 326 | - // $this->add_responsive_control( | |
| 327 | - // 'background_image_attachment', | |
| 328 | - // [ | |
| 329 | - // 'label' => _x( 'Attachment', 'ultimate-store-kit' ), | |
| 330 | - // 'type' => Controls_Manager::SELECT, | |
| 331 | - // 'default' => '', | |
| 332 | - // 'options' => [ | |
| 333 | - // '' => _x( 'Default', 'ultimate-store-kit' ), | |
| 334 | - // 'scroll' => _x( 'Scroll', 'ultimate-store-kit' ), | |
| 335 | - // 'fixed' => _x( 'Fixed', 'ultimate-store-kit' ), | |
| 336 | - // ], | |
| 337 | - // 'selectors' => [ | |
| 338 | - // '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-attachment: {{VALUE}};', | |
| 339 | - // ], | |
| 340 | - // 'condition' => [ | |
| 341 | - // 'background_image_toggle' => 'yes' | |
| 342 | - // ], | |
| 343 | - // 'render_type' => 'ui', | |
| 344 | - // ] | |
| 345 | - // ); | |
| 346 | - | |
| 347 | - // $this->add_responsive_control( | |
| 348 | - // 'background_image_repeat', | |
| 349 | - // [ | |
| 350 | - // 'label' => _x( 'Repeat', 'ultimate-store-kit' ), | |
| 351 | - // 'type' => Controls_Manager::SELECT, | |
| 352 | - // 'default' => '', | |
| 353 | - // 'options' => [ | |
| 354 | - // '' => _x( 'Default', 'ultimate-store-kit' ), | |
| 355 | - // 'no-repeat' => _x( 'No-repeat', 'ultimate-store-kit' ), | |
| 356 | - // 'repeat' => _x( 'Repeat', 'ultimate-store-kit' ), | |
| 357 | - // 'repeat-x' => _x( 'Repeat-x', 'ultimate-store-kit' ), | |
| 358 | - // 'repeat-y' => _x( 'Repeat-y', 'ultimate-store-kit' ), | |
| 359 | - // ], | |
| 360 | - // 'selectors' => [ | |
| 361 | - // '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-repeat: {{VALUE}};', | |
| 362 | - // ], | |
| 363 | - // 'condition' => [ | |
| 364 | - // 'background_image_toggle' => 'yes' | |
| 365 | - // ], | |
| 366 | - // 'render_type' => 'ui', | |
| 367 | - // ] | |
| 368 | - // ); | |
| 369 | - | |
| 370 | - // $this->add_responsive_control( | |
| 371 | - // 'background_image_size', | |
| 372 | - // [ | |
| 373 | - // 'label' => _x( 'Size', 'ultimate-store-kit' ), | |
| 374 | - // 'type' => Controls_Manager::SELECT, | |
| 375 | - // 'default' => '', | |
| 376 | - // 'options' => [ | |
| 377 | - // '' => _x( 'Default', 'ultimate-store-kit' ), | |
| 378 | - // 'auto' => _x( 'Auto', 'ultimate-store-kit' ), | |
| 379 | - // 'cover' => _x( 'Cover', 'ultimate-store-kit' ), | |
| 380 | - // 'contain' => _x( 'Contain', 'ultimate-store-kit' ), | |
| 381 | - // 'initial' => _x( 'Custom', 'ultimate-store-kit' ), | |
| 382 | - // ], | |
| 383 | - // 'selectors' => [ | |
| 384 | - // '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-size: {{VALUE}};', | |
| 385 | - // ], | |
| 386 | - // 'condition' => [ | |
| 387 | - // 'background_image_toggle' => 'yes' | |
| 388 | - // ], | |
| 389 | - // 'render_type' => 'ui', | |
| 390 | - // ] | |
| 391 | - // ); | |
| 392 | - | |
| 393 | - // $this->add_responsive_control( | |
| 394 | - // 'background_image_width', | |
| 395 | - // [ | |
| 396 | - // 'label' => _x( 'Width', 'ultimate-store-kit' ), | |
| 397 | - // 'type' => Controls_Manager::SLIDER, | |
| 398 | - // 'size_units' => [ 'px', 'em', '%', 'vw' ], | |
| 399 | - // 'range' => [ | |
| 400 | - // 'px' => [ | |
| 401 | - // 'min' => 0, | |
| 402 | - // 'max' => 1000, | |
| 403 | - // ], | |
| 404 | - // '%' => [ | |
| 405 | - // 'min' => 0, | |
| 406 | - // 'max' => 100, | |
| 407 | - // ], | |
| 408 | - // 'vw' => [ | |
| 409 | - // 'min' => 0, | |
| 410 | - // 'max' => 100, | |
| 411 | - // ], | |
| 412 | - // ], | |
| 413 | - // 'default' => [ | |
| 414 | - // 'size' => 100, | |
| 415 | - // 'unit' => '%', | |
| 416 | - // ], | |
| 417 | - // 'required' => true, | |
| 418 | - // 'selectors' => [ | |
| 419 | - // '{{WRAPPER}} .usk-featured-box .usk-image-wrap' => 'background-size: {{SIZE}}{{UNIT}} auto', | |
| 420 | - | |
| 421 | - // ], | |
| 422 | - // 'condition' => [ | |
| 423 | - // 'background_image_size' => [ 'initial' ], | |
| 424 | - // ], | |
| 425 | - // 'render_type' => 'ui', | |
| 426 | - // ] | |
| 427 | - // ); | |
| 428 | - | |
| 429 | - // $this->end_popover(); | |
| 430 | - | |
| 431 | 496 | $this->add_control( |
| 432 | 497 | 'show_title', |
| 433 | 498 | [ |
| 434 | - 'label' => __('Show Title', 'ultimate-store-kit'), | |
| 435 | - 'type' => Controls_Manager::SWITCHER, | |
| 499 | + 'label' => __('Show Title', 'ultimate-store-kit'), | |
| 500 | + 'type' => Controls_Manager::SWITCHER, | |
| 436 | 501 | 'default' => 'yes', |
| 437 | 502 | 'separator' => 'before', |
| 438 | 503 | ] |
| 439 | 504 | ); |
| @@ -440,15 +505,15 @@ | ||
| 440 | 505 | |
| 441 | 506 | $this->add_control( |
| 442 | 507 | 'title_tag', |
| 443 | 508 | [ |
| 444 | - 'label' => __('Title HTML Tag', 'ultimate-store-kit'), | |
| 445 | - 'type' => Controls_Manager::SELECT, | |
| 509 | + 'label' => __('Title HTML Tag', 'ultimate-store-kit'), | |
| 510 | + 'type' => Controls_Manager::SELECT, | |
| 446 | 511 | 'default' => 'h3', |
| 447 | 512 | 'options' => ultimate_store_kit_title_tags(), |
| 448 | 513 | 'condition' => [ |
| 449 | 514 | 'show_title' => 'yes', |
| 450 | - ] | |
| 515 | + ], | |
| 451 | 516 | ] |
| 452 | 517 | ); |
| 453 | 518 | |
| 454 | 519 | $this->add_control( |
| @@ -453,12 +518,12 @@ | ||
| 453 | 518 | |
| 454 | 519 | $this->add_control( |
| 455 | 520 | 'show_text', |
| 456 | 521 | [ |
| 457 | - 'label' => esc_html__('Show Text', 'ultimate-store-kit'), | |
| 458 | - 'type' => Controls_Manager::SWITCHER, | |
| 522 | + 'label' => esc_html__('Show Text', 'ultimate-store-kit'), | |
| 523 | + 'type' => Controls_Manager::SWITCHER, | |
| 459 | 524 | 'default' => 'yes', |
| 460 | - 'separator' => 'before' | |
| 525 | + 'separator' => 'before', | |
| 461 | 526 | ] |
| 462 | 527 | ); |
| 463 | 528 | |
| 464 | 529 | $this->add_control( |
| @@ -463,10 +528,10 @@ | ||
| 463 | 528 | |
| 464 | 529 | $this->add_control( |
| 465 | 530 | 'show_meta', |
| 466 | 531 | [ |
| 467 | - 'label' => esc_html__('Show Meta', 'ultimate-store-kit'), | |
| 468 | - 'type' => Controls_Manager::SWITCHER, | |
| 532 | + 'label' => esc_html__('Show Meta', 'ultimate-store-kit'), | |
| 533 | + 'type' => Controls_Manager::SWITCHER, | |
| 469 | 534 | 'default' => 'yes', |
| 470 | 535 | ] |
| 471 | 536 | ); |
| 472 | 537 | |
| @@ -472,20 +537,27 @@ | ||
| 472 | 537 | |
| 473 | 538 | $this->add_control( |
| 474 | 539 | 'show_readmore', |
| 475 | 540 | [ |
| 476 | - 'label' => esc_html__('Show Button', 'ultimate-store-kit'), | |
| 477 | - 'type' => Controls_Manager::SWITCHER, | |
| 541 | + 'label' => esc_html__('Show Button', 'ultimate-store-kit'), | |
| 542 | + 'type' => Controls_Manager::SWITCHER, | |
| 478 | 543 | 'default' => 'yes', |
| 479 | 544 | ] |
| 480 | 545 | ); |
| 546 | + $this->add_control( | |
| 547 | + 'badge', | |
| 548 | + [ | |
| 549 | + 'label' => esc_html__('Badge', 'ultimate-store-kit') . BDTUSK_NC, | |
| 550 | + 'type' => Controls_Manager::SWITCHER, | |
| 551 | + ] | |
| 552 | + ); | |
| 481 | 553 | |
| 482 | 554 | $this->add_control( |
| 483 | 555 | 'show_wrapper_link', |
| 484 | 556 | [ |
| 485 | - 'label' => esc_html__('Show Wrapper link', 'ultimate-store-kit'), | |
| 486 | - 'type' => Controls_Manager::SWITCHER, | |
| 487 | - 'separator' => 'before' | |
| 557 | + 'label' => esc_html__('Show Wrapper link', 'ultimate-store-kit'), | |
| 558 | + 'type' => Controls_Manager::SWITCHER, | |
| 559 | + 'separator' => 'before', | |
| 488 | 560 | ] |
| 489 | 561 | ); |
| 490 | 562 | |
| 491 | 563 | $this->add_control( |
| @@ -490,29 +562,29 @@ | ||
| 490 | 562 | |
| 491 | 563 | $this->add_control( |
| 492 | 564 | 'wrapper_link', |
| 493 | 565 | [ |
| 494 | - 'label' => esc_html__('Wrapper Link', 'ultimate-store-kit'), | |
| 495 | - 'type' => Controls_Manager::URL, | |
| 496 | - 'dynamic' => [ 'active' => true ], | |
| 566 | + 'label' => esc_html__('Wrapper Link', 'ultimate-store-kit'), | |
| 567 | + 'type' => Controls_Manager::URL, | |
| 568 | + 'dynamic' => ['active' => true], | |
| 497 | 569 | 'placeholder' => 'http://your-link.com', |
| 498 | - 'default' => [ | |
| 570 | + 'default' => [ | |
| 499 | 571 | 'url' => '#', |
| 500 | 572 | ], |
| 501 | 573 | 'condition' => [ |
| 502 | 574 | 'show_wrapper_link' => 'yes', |
| 503 | - ] | |
| 575 | + ], | |
| 504 | 576 | ] |
| 505 | 577 | ); |
| 506 | 578 | |
| 507 | 579 | $this->end_controls_section(); |
| 508 | - | |
| 580 | + | |
| 509 | 581 | //Style |
| 510 | 582 | $this->start_controls_section( |
| 511 | 583 | 'section_style_items', |
| 512 | 584 | [ |
| 513 | 585 | 'label' => __('Featured Box', 'ultimate-store-kit'), |
| 514 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 586 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 515 | 587 | ] |
| 516 | 588 | ); |
| 517 | 589 | |
| 518 | 590 | $this->start_controls_tabs('tabs_item_style'); |
| @@ -526,10 +598,10 @@ | ||
| 526 | 598 | |
| 527 | 599 | $this->add_group_control( |
| 528 | 600 | Group_Control_Background::get_type(), |
| 529 | 601 | [ |
| 530 | - 'name' => 'item_background', | |
| 531 | - 'selector' => '{{WRAPPER}} .usk-featured-box-item', | |
| 602 | + 'name' => 'item_background', | |
| 603 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-item', | |
| 532 | 604 | ] |
| 533 | 605 | ); |
| 534 | 606 | |
| 535 | 607 | $this->add_group_control( |
| @@ -534,10 +606,10 @@ | ||
| 534 | 606 | |
| 535 | 607 | $this->add_group_control( |
| 536 | 608 | Group_Control_Border::get_type(), |
| 537 | 609 | [ |
| 538 | - 'name' => 'item_border', | |
| 539 | - 'label' => esc_html__('Border', 'ultimate-store-kit'), | |
| 610 | + 'name' => 'item_border', | |
| 611 | + 'label' => esc_html__('Border', 'ultimate-store-kit'), | |
| 540 | 612 | // 'fields_options' => [ |
| 541 | 613 | // 'border' => [ |
| 542 | 614 | // 'default' => 'solid', |
| 543 | 615 | // ], |
| @@ -553,10 +625,10 @@ | ||
| 553 | 625 | // 'color' => [ |
| 554 | 626 | // 'default' => '#eee', |
| 555 | 627 | // ], |
| 556 | 628 | // ], |
| 557 | - 'selector' => '{{WRAPPER}} .usk-featured-box-item', | |
| 558 | - 'separator' => 'before', | |
| 629 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-item', | |
| 630 | + 'separator' => 'before', | |
| 559 | 631 | ] |
| 560 | 632 | ); |
| 561 | 633 | |
| 562 | 634 | $this->add_responsive_control( |
| @@ -561,13 +633,13 @@ | ||
| 561 | 633 | |
| 562 | 634 | $this->add_responsive_control( |
| 563 | 635 | 'item_border_radius', |
| 564 | 636 | [ |
| 565 | - 'label' => esc_html__('Border Radius', 'ultimate-store-kit'), | |
| 566 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 567 | - 'size_units' => [ 'px', 'em', '%' ], | |
| 568 | - 'selectors' => [ | |
| 569 | - '{{WRAPPER}} .usk-featured-box-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 637 | + 'label' => esc_html__('Border Radius', 'ultimate-store-kit'), | |
| 638 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 639 | + 'size_units' => ['px', 'em', '%'], | |
| 640 | + 'selectors' => [ | |
| 641 | + '{{WRAPPER}} .usk-featured-box .usk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 570 | 642 | ], |
| 571 | 643 | ] |
| 572 | 644 | ); |
| 573 | 645 | |
| @@ -573,13 +645,13 @@ | ||
| 573 | 645 | |
| 574 | 646 | $this->add_responsive_control( |
| 575 | 647 | 'item_padding', |
| 576 | 648 | [ |
| 577 | - 'label' => esc_html__('Padding', 'ultimate-store-kit'), | |
| 578 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 579 | - 'size_units' => [ 'px', 'em', '%' ], | |
| 580 | - 'selectors' => [ | |
| 581 | - '{{WRAPPER}} .usk-featured-box-item .usk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 649 | + 'label' => esc_html__('Padding', 'ultimate-store-kit'), | |
| 650 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 651 | + 'size_units' => ['px', 'em', '%'], | |
| 652 | + 'selectors' => [ | |
| 653 | + '{{WRAPPER}} .usk-featured-box .usk-item .usk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 582 | 654 | ], |
| 583 | 655 | ] |
| 584 | 656 | ); |
| 585 | 657 | |
| @@ -585,10 +657,10 @@ | ||
| 585 | 657 | |
| 586 | 658 | $this->add_group_control( |
| 587 | 659 | Group_Control_Box_Shadow::get_type(), |
| 588 | 660 | [ |
| 589 | - 'name' => 'item_box_shadow', | |
| 590 | - 'selector' => '{{WRAPPER}} .usk-featured-box-item', | |
| 661 | + 'name' => 'item_box_shadow', | |
| 662 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-item', | |
| 591 | 663 | ] |
| 592 | 664 | ); |
| 593 | 665 | |
| 594 | 666 | $this->end_controls_tab(); |
| @@ -602,10 +674,10 @@ | ||
| 602 | 674 | |
| 603 | 675 | $this->add_group_control( |
| 604 | 676 | Group_Control_Background::get_type(), |
| 605 | 677 | [ |
| 606 | - 'name' => 'item_hover_background', | |
| 607 | - 'selector' => '{{WRAPPER}} .usk-featured-box-item:hover', | |
| 678 | + 'name' => 'item_hover_background', | |
| 679 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-item:hover', | |
| 608 | 680 | ] |
| 609 | 681 | ); |
| 610 | 682 | |
| 611 | 683 | $this->add_control( |
| @@ -610,18 +682,18 @@ | ||
| 610 | 682 | |
| 611 | 683 | $this->add_control( |
| 612 | 684 | 'item_hover_border_color', |
| 613 | 685 | [ |
| 614 | - 'label' => esc_html__('Border Color', 'ultimate-store-kit'), | |
| 615 | - 'type' => Controls_Manager::COLOR, | |
| 616 | - 'default' => '#333', | |
| 686 | + 'label' => esc_html__('Border Color', 'ultimate-store-kit'), | |
| 687 | + 'type' => Controls_Manager::COLOR, | |
| 688 | + 'default' => '#333', | |
| 617 | 689 | 'condition' => [ |
| 618 | 690 | 'item_border_border!' => '', |
| 619 | 691 | ], |
| 620 | 692 | 'selectors' => [ |
| 621 | - '{{WRAPPER}} .usk-featured-box-item:hover' => 'border-color: {{VALUE}};', | |
| 693 | + '{{WRAPPER}} .usk-featured-box .usk-item:hover' => 'border-color: {{VALUE}};', | |
| 622 | 694 | ], |
| 623 | - 'separator' => 'before' | |
| 695 | + 'separator' => 'before', | |
| 624 | 696 | ] |
| 625 | 697 | ); |
| 626 | 698 | |
| 627 | 699 | $this->add_group_control( |
| @@ -626,10 +698,10 @@ | ||
| 626 | 698 | |
| 627 | 699 | $this->add_group_control( |
| 628 | 700 | Group_Control_Box_Shadow::get_type(), |
| 629 | 701 | [ |
| 630 | - 'name' => 'item_hover_box_shadow', | |
| 631 | - 'selector' => '{{WRAPPER}} .usk-featured-box-item:hover', | |
| 702 | + 'name' => 'item_hover_box_shadow', | |
| 703 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-item:hover', | |
| 632 | 704 | ] |
| 633 | 705 | ); |
| 634 | 706 | |
| 635 | 707 | $this->end_controls_tab(); |
| @@ -673,12 +745,12 @@ | ||
| 673 | 745 | |
| 674 | 746 | $this->add_responsive_control( |
| 675 | 747 | 'title_margin', |
| 676 | 748 | [ |
| 677 | - 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 678 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 679 | - 'size_units' => [ 'px', 'em', '%' ], | |
| 680 | - 'selectors' => [ | |
| 749 | + 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 750 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 751 | + 'size_units' => ['px', 'em', '%'], | |
| 752 | + 'selectors' => [ | |
| 681 | 753 | '{{WRAPPER}} .usk-featured-box .usk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 682 | 754 | ], |
| 683 | 755 | ] |
| 684 | 756 | ); |
| @@ -696,9 +768,9 @@ | ||
| 696 | 768 | $this->start_controls_section( |
| 697 | 769 | 'section_style_text', |
| 698 | 770 | [ |
| 699 | 771 | 'label' => __('Text', 'ultimate-store-kit'), |
| 700 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 772 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 701 | 773 | 'condition' => [ |
| 702 | 774 | 'show_text' => 'yes', |
| 703 | 775 | ], |
| 704 | 776 | ] |
| @@ -706,10 +778,10 @@ | ||
| 706 | 778 | |
| 707 | 779 | $this->add_control( |
| 708 | 780 | 'text_color', |
| 709 | 781 | [ |
| 710 | - 'label' => __('Color', 'ultimate-store-kit'), | |
| 711 | - 'type' => Controls_Manager::COLOR, | |
| 782 | + 'label' => __('Color', 'ultimate-store-kit'), | |
| 783 | + 'type' => Controls_Manager::COLOR, | |
| 712 | 784 | 'selectors' => [ |
| 713 | 785 | '{{WRAPPER}} .usk-featured-box .usk-text' => 'color: {{VALUE}};', |
| 714 | 786 | ], |
| 715 | 787 | ] |
| @@ -717,12 +789,12 @@ | ||
| 717 | 789 | |
| 718 | 790 | $this->add_responsive_control( |
| 719 | 791 | 'text_margin', |
| 720 | 792 | [ |
| 721 | - 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 722 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 723 | - 'size_units' => [ 'px', 'em', '%' ], | |
| 724 | - 'selectors' => [ | |
| 793 | + 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 794 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 795 | + 'size_units' => ['px', 'em', '%'], | |
| 796 | + 'selectors' => [ | |
| 725 | 797 | '{{WRAPPER}} .usk-featured-box .usk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 726 | 798 | ], |
| 727 | 799 | ] |
| 728 | 800 | ); |
| @@ -729,9 +801,9 @@ | ||
| 729 | 801 | |
| 730 | 802 | $this->add_group_control( |
| 731 | 803 | Group_Control_Typography::get_type(), |
| 732 | 804 | [ |
| 733 | - 'name' => 'text_typography', | |
| 805 | + 'name' => 'text_typography', | |
| 734 | 806 | 'selector' => '{{WRAPPER}} .usk-featured-box .usk-text', |
| 735 | 807 | ] |
| 736 | 808 | ); |
| 737 | 809 | |
| @@ -740,9 +812,9 @@ | ||
| 740 | 812 | $this->start_controls_section( |
| 741 | 813 | 'section_style_meta', |
| 742 | 814 | [ |
| 743 | 815 | 'label' => __('Meta', 'ultimate-store-kit'), |
| 744 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 816 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 745 | 817 | 'condition' => [ |
| 746 | 818 | 'show_meta' => 'yes', |
| 747 | 819 | ], |
| 748 | 820 | ] |
| @@ -750,10 +822,10 @@ | ||
| 750 | 822 | |
| 751 | 823 | $this->add_control( |
| 752 | 824 | 'meta_color', |
| 753 | 825 | [ |
| 754 | - 'label' => __('Color', 'ultimate-store-kit'), | |
| 755 | - 'type' => Controls_Manager::COLOR, | |
| 826 | + 'label' => __('Color', 'ultimate-store-kit'), | |
| 827 | + 'type' => Controls_Manager::COLOR, | |
| 756 | 828 | 'selectors' => [ |
| 757 | 829 | '{{WRAPPER}} .usk-featured-box .usk-meta' => 'color: {{VALUE}};', |
| 758 | 830 | ], |
| 759 | 831 | ] |
| @@ -761,10 +833,10 @@ | ||
| 761 | 833 | |
| 762 | 834 | $this->add_control( |
| 763 | 835 | 'meta_color_hover', |
| 764 | 836 | [ |
| 765 | - 'label' => __('Hover Color', 'ultimate-store-kit'), | |
| 766 | - 'type' => Controls_Manager::COLOR, | |
| 837 | + 'label' => __('Hover Color', 'ultimate-store-kit'), | |
| 838 | + 'type' => Controls_Manager::COLOR, | |
| 767 | 839 | 'selectors' => [ |
| 768 | 840 | '{{WRAPPER}} .usk-featured-box .usk-meta:hover' => 'color: {{VALUE}};', |
| 769 | 841 | ], |
| 770 | 842 | ] |
| @@ -772,12 +844,12 @@ | ||
| 772 | 844 | |
| 773 | 845 | $this->add_responsive_control( |
| 774 | 846 | 'meta_margin', |
| 775 | 847 | [ |
| 776 | - 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 777 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 778 | - 'size_units' => [ 'px', 'em', '%' ], | |
| 779 | - 'selectors' => [ | |
| 848 | + 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 849 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 850 | + 'size_units' => ['px', 'em', '%'], | |
| 851 | + 'selectors' => [ | |
| 780 | 852 | '{{WRAPPER}} .usk-featured-box .usk-meta' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 781 | 853 | ], |
| 782 | 854 | ] |
| 783 | 855 | ); |
| @@ -784,9 +856,9 @@ | ||
| 784 | 856 | |
| 785 | 857 | $this->add_group_control( |
| 786 | 858 | Group_Control_Typography::get_type(), |
| 787 | 859 | [ |
| 788 | - 'name' => 'meta_typography', | |
| 860 | + 'name' => 'meta_typography', | |
| 789 | 861 | 'selector' => '{{WRAPPER}} .usk-featured-box .usk-meta', |
| 790 | 862 | ] |
| 791 | 863 | ); |
| 792 | 864 | |
| @@ -794,10 +866,10 @@ | ||
| 794 | 866 | |
| 795 | 867 | $this->start_controls_section( |
| 796 | 868 | 'section_style_readmore', |
| 797 | 869 | [ |
| 798 | - 'label' => esc_html__('Button', 'ultimate-store-kit'), | |
| 799 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 870 | + 'label' => esc_html__('Button', 'ultimate-store-kit'), | |
| 871 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 800 | 872 | 'condition' => [ |
| 801 | 873 | 'show_readmore' => 'yes', |
| 802 | 874 | ], |
| 803 | 875 | ] |
| @@ -802,8 +874,111 @@ | ||
| 802 | 874 | ], |
| 803 | 875 | ] |
| 804 | 876 | ); |
| 805 | 877 | |
| 878 | + $this->add_control( | |
| 879 | + 'button_offset_toggle', | |
| 880 | + [ | |
| 881 | + 'label' => __('Offset', 'ultimate-store-kit'), | |
| 882 | + 'type' => Controls_Manager::POPOVER_TOGGLE, | |
| 883 | + 'label_off' => __('None', 'ultimate-store-kit'), | |
| 884 | + 'label_on' => __('Custom', 'ultimate-store-kit'), | |
| 885 | + 'return_value' => 'yes', | |
| 886 | + ] | |
| 887 | + ); | |
| 888 | + $this->start_popover(); | |
| 889 | + $this->add_responsive_control( | |
| 890 | + 'button_x_position', | |
| 891 | + [ | |
| 892 | + 'label' => __( 'X', 'ultimate-store-kit' ), | |
| 893 | + 'type' => Controls_Manager::SLIDER, | |
| 894 | + 'default' => [ | |
| 895 | + 'size' => 0, | |
| 896 | + ], | |
| 897 | + 'tablet_default' => [ | |
| 898 | + 'size' => 0, | |
| 899 | + ], | |
| 900 | + 'mobile_default' => [ | |
| 901 | + 'size' => 0, | |
| 902 | + ], | |
| 903 | + 'range' => [ | |
| 904 | + 'px' => [ | |
| 905 | + 'min' => -800, | |
| 906 | + 'max' => 800, | |
| 907 | + ], | |
| 908 | + ], | |
| 909 | + 'condition' => [ | |
| 910 | + 'button_offset_toggle' => 'yes' | |
| 911 | + ], | |
| 912 | + 'render_type' => 'ui', | |
| 913 | + 'selectors' => [ | |
| 914 | + '{{WRAPPER}}' => '--usk-button-x-offset: {{SIZE}}px;' | |
| 915 | + ], | |
| 916 | + ] | |
| 917 | + ); | |
| 918 | + | |
| 919 | + $this->add_responsive_control( | |
| 920 | + 'button_y_position', | |
| 921 | + [ | |
| 922 | + 'label' => __( 'Y', 'ultimate-store-kit' ), | |
| 923 | + 'type' => Controls_Manager::SLIDER, | |
| 924 | + 'default' => [ | |
| 925 | + 'size' => 0, | |
| 926 | + ], | |
| 927 | + 'tablet_default' => [ | |
| 928 | + 'size' => 0, | |
| 929 | + ], | |
| 930 | + 'mobile_default' => [ | |
| 931 | + 'size' => 0, | |
| 932 | + ], | |
| 933 | + 'range' => [ | |
| 934 | + 'px' => [ | |
| 935 | + 'min' => -800, | |
| 936 | + 'max' => 800, | |
| 937 | + ], | |
| 938 | + ], | |
| 939 | + 'condition' => [ | |
| 940 | + 'button_offset_toggle' => 'yes' | |
| 941 | + ], | |
| 942 | + 'render_type' => 'ui', | |
| 943 | + 'selectors' => [ | |
| 944 | + '{{WRAPPER}}' => '--usk-button-y-offset: {{SIZE}}px;' | |
| 945 | + ], | |
| 946 | + ] | |
| 947 | + ); | |
| 948 | + | |
| 949 | + $this->add_responsive_control( | |
| 950 | + 'button_rotate', | |
| 951 | + [ | |
| 952 | + 'label' => __( 'Rotate', 'ultimate-store-kit' ), | |
| 953 | + 'type' => Controls_Manager::SLIDER, | |
| 954 | + 'default' => [ | |
| 955 | + 'size' => 0, | |
| 956 | + ], | |
| 957 | + 'tablet_default' => [ | |
| 958 | + 'size' => 0, | |
| 959 | + ], | |
| 960 | + 'mobile_default' => [ | |
| 961 | + 'size' => 0, | |
| 962 | + ], | |
| 963 | + 'range' => [ | |
| 964 | + 'px' => [ | |
| 965 | + 'min' => -180, | |
| 966 | + 'max' => 180, | |
| 967 | + 'step' => 5, | |
| 968 | + ], | |
| 969 | + ], | |
| 970 | + 'condition' => [ | |
| 971 | + 'button_offset_toggle' => 'yes' | |
| 972 | + ], | |
| 973 | + 'render_type' => 'ui', | |
| 974 | + 'selectors' => [ | |
| 975 | + '{{WRAPPER}}' => '--usk-button-rotate: {{SIZE}}deg;' | |
| 976 | + ], | |
| 977 | + ] | |
| 978 | + ); | |
| 979 | + $this->end_popover(); | |
| 980 | + | |
| 806 | 981 | $this->start_controls_tabs('tabs_readmore_style'); |
| 807 | 982 | |
| 808 | 983 | $this->start_controls_tab( |
| 809 | 984 | 'tab_readmore_normal', |
| @@ -814,10 +989,10 @@ | ||
| 814 | 989 | |
| 815 | 990 | $this->add_control( |
| 816 | 991 | 'readmore_color', |
| 817 | 992 | [ |
| 818 | - 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 819 | - 'type' => Controls_Manager::COLOR, | |
| 993 | + 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 994 | + 'type' => Controls_Manager::COLOR, | |
| 820 | 995 | 'selectors' => [ |
| 821 | 996 | '{{WRAPPER}} .usk-featured-box .usk-link-btn a' => 'color: {{VALUE}};', |
| 822 | 997 | ], |
| 823 | 998 | ] |
| @@ -825,10 +1000,10 @@ | ||
| 825 | 1000 | |
| 826 | 1001 | $this->add_group_control( |
| 827 | 1002 | Group_Control_Background::get_type(), |
| 828 | 1003 | [ |
| 829 | - 'name' => 'readmore_background', | |
| 830 | - 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a', | |
| 1004 | + 'name' => 'readmore_background', | |
| 1005 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a', | |
| 831 | 1006 | ] |
| 832 | 1007 | ); |
| 833 | 1008 | |
| 834 | 1009 | $this->add_group_control( |
| @@ -833,29 +1008,29 @@ | ||
| 833 | 1008 | |
| 834 | 1009 | $this->add_group_control( |
| 835 | 1010 | Group_Control_Border::get_type(), |
| 836 | 1011 | [ |
| 837 | - 'name' => 'readmore_border', | |
| 838 | - 'label' => esc_html__('Border', 'ultimate-store-kit'), | |
| 1012 | + 'name' => 'readmore_border', | |
| 1013 | + 'label' => esc_html__('Border', 'ultimate-store-kit'), | |
| 839 | 1014 | 'fields_options' => [ |
| 840 | 1015 | 'border' => [ |
| 841 | 1016 | 'default' => 'solid', |
| 842 | 1017 | ], |
| 843 | - 'width' => [ | |
| 1018 | + 'width' => [ | |
| 844 | 1019 | 'default' => [ |
| 845 | - 'top' => '1', | |
| 846 | - 'right' => '1', | |
| 847 | - 'bottom' => '1', | |
| 848 | - 'left' => '1', | |
| 1020 | + 'top' => '1', | |
| 1021 | + 'right' => '1', | |
| 1022 | + 'bottom' => '1', | |
| 1023 | + 'left' => '1', | |
| 849 | 1024 | 'isLinked' => false, |
| 850 | 1025 | ], |
| 851 | 1026 | ], |
| 852 | - 'color' => [ | |
| 1027 | + 'color' => [ | |
| 853 | 1028 | 'default' => '#D90429', |
| 854 | 1029 | ], |
| 855 | 1030 | ], |
| 856 | - 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a', | |
| 857 | - 'separator' => 'before', | |
| 1031 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a', | |
| 1032 | + 'separator' => 'before', | |
| 858 | 1033 | ] |
| 859 | 1034 | ); |
| 860 | 1035 | |
| 861 | 1036 | $this->add_responsive_control( |
| @@ -860,25 +1035,24 @@ | ||
| 860 | 1035 | |
| 861 | 1036 | $this->add_responsive_control( |
| 862 | 1037 | 'readmore_radius', |
| 863 | 1038 | [ |
| 864 | - 'label' => esc_html__('Border Radius', 'ultimate-store-kit'), | |
| 865 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 866 | - 'size_units' => [ 'px', '%' ], | |
| 867 | - 'selectors' => [ | |
| 1039 | + 'label' => esc_html__('Border Radius', 'ultimate-store-kit'), | |
| 1040 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1041 | + 'size_units' => ['px', '%'], | |
| 1042 | + 'selectors' => [ | |
| 868 | 1043 | '{{WRAPPER}} .usk-featured-box .usk-link-btn a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 869 | 1044 | ], |
| 870 | 1045 | ] |
| 871 | 1046 | ); |
| 872 | 1047 | |
| 873 | - | |
| 874 | 1048 | $this->add_responsive_control( |
| 875 | 1049 | 'readmore_padding', |
| 876 | 1050 | [ |
| 877 | - 'label' => esc_html__('Padding', 'ultimate-store-kit'), | |
| 878 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 879 | - 'size_units' => [ 'px', 'em', '%' ], | |
| 880 | - 'selectors' => [ | |
| 1051 | + 'label' => esc_html__('Padding', 'ultimate-store-kit'), | |
| 1052 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1053 | + 'size_units' => ['px', 'em', '%'], | |
| 1054 | + 'selectors' => [ | |
| 881 | 1055 | '{{WRAPPER}} .usk-featured-box .usk-link-btn a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 882 | 1056 | ], |
| 883 | 1057 | ] |
| 884 | 1058 | ); |
| @@ -885,12 +1059,12 @@ | ||
| 885 | 1059 | |
| 886 | 1060 | $this->add_responsive_control( |
| 887 | 1061 | 'readmore_margin', |
| 888 | 1062 | [ |
| 889 | - 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 890 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 891 | - 'size_units' => [ 'px', 'em', '%' ], | |
| 892 | - 'selectors' => [ | |
| 1063 | + 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 1064 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1065 | + 'size_units' => ['px', 'em', '%'], | |
| 1066 | + 'selectors' => [ | |
| 893 | 1067 | '{{WRAPPER}} .usk-featured-box .usk-link-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 894 | 1068 | ], |
| 895 | 1069 | ] |
| 896 | 1070 | ); |
| @@ -897,9 +1071,9 @@ | ||
| 897 | 1071 | |
| 898 | 1072 | $this->add_group_control( |
| 899 | 1073 | Group_Control_Typography::get_type(), |
| 900 | 1074 | [ |
| 901 | - 'name' => 'readmore_typography', | |
| 1075 | + 'name' => 'readmore_typography', | |
| 902 | 1076 | 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a', |
| 903 | 1077 | ] |
| 904 | 1078 | ); |
| 905 | 1079 | |
| @@ -905,9 +1079,9 @@ | ||
| 905 | 1079 | |
| 906 | 1080 | $this->add_group_control( |
| 907 | 1081 | Group_Control_Box_Shadow::get_type(), |
| 908 | 1082 | [ |
| 909 | - 'name' => 'readmore_box_shadow', | |
| 1083 | + 'name' => 'readmore_box_shadow', | |
| 910 | 1084 | 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a', |
| 911 | 1085 | ] |
| 912 | 1086 | ); |
| 913 | 1087 | |
| @@ -922,10 +1096,10 @@ | ||
| 922 | 1096 | |
| 923 | 1097 | $this->add_control( |
| 924 | 1098 | 'readmore_hover_color', |
| 925 | 1099 | [ |
| 926 | - 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 927 | - 'type' => Controls_Manager::COLOR, | |
| 1100 | + 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 1101 | + 'type' => Controls_Manager::COLOR, | |
| 928 | 1102 | 'selectors' => [ |
| 929 | 1103 | '{{WRAPPER}} .usk-featured-box .usk-link-btn a:hover' => 'color: {{VALUE}};', |
| 930 | 1104 | '{{WRAPPER}} .usk-featured-box .usk-link-btn a span::before' => 'background-color: {{VALUE}};', |
| 931 | 1105 | '{{WRAPPER}} .usk-featured-box .usk-link-btn a span::after' => 'border-top-color: {{VALUE}}; border-right-color: {{VALUE}};', |
| @@ -935,10 +1109,10 @@ | ||
| 935 | 1109 | |
| 936 | 1110 | $this->add_group_control( |
| 937 | 1111 | Group_Control_Background::get_type(), |
| 938 | 1112 | [ |
| 939 | - 'name' => 'readmore_hover_background', | |
| 940 | - 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a:before', | |
| 1113 | + 'name' => 'readmore_hover_background', | |
| 1114 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-link-btn a:before', | |
| 941 | 1115 | ] |
| 942 | 1116 | ); |
| 943 | 1117 | |
| 944 | 1118 | $this->add_control( |
| @@ -943,10 +1117,10 @@ | ||
| 943 | 1117 | |
| 944 | 1118 | $this->add_control( |
| 945 | 1119 | 'readmore_hover_border_color', |
| 946 | 1120 | [ |
| 947 | - 'label' => esc_html__('Border Color', 'ultimate-store-kit'), | |
| 948 | - 'type' => Controls_Manager::COLOR, | |
| 1121 | + 'label' => esc_html__('Border Color', 'ultimate-store-kit'), | |
| 1122 | + 'type' => Controls_Manager::COLOR, | |
| 949 | 1123 | 'condition' => [ |
| 950 | 1124 | 'readmore_border_border!' => '', |
| 951 | 1125 | ], |
| 952 | 1126 | 'selectors' => [ |
| @@ -955,50 +1129,300 @@ | ||
| 955 | 1129 | ] |
| 956 | 1130 | ); |
| 957 | 1131 | |
| 958 | 1132 | $this->end_controls_tab(); |
| 1133 | + $this->end_controls_tabs(); | |
| 1134 | + $this->end_controls_section(); | |
| 959 | 1135 | |
| 1136 | + $this->start_controls_section( | |
| 1137 | + 'section_style_badge', | |
| 1138 | + [ | |
| 1139 | + 'label' => esc_html__('Badge', 'ultimate-store-kit'), | |
| 1140 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1141 | + 'condition' => [ | |
| 1142 | + 'badge' => 'yes', | |
| 1143 | + 'badge_text!' => '', | |
| 1144 | + ], | |
| 1145 | + ] | |
| 1146 | + ); | |
| 1147 | + $this->add_responsive_control( | |
| 1148 | + 'badge_position', | |
| 1149 | + [ | |
| 1150 | + 'label' => esc_html__('Position', 'ultimate-store-kit'), | |
| 1151 | + 'type' => Controls_Manager::SELECT, | |
| 1152 | + 'default' => 'top-right', | |
| 1153 | + 'options' => [ | |
| 1154 | + 'top-left' => esc_html__('Top Left', 'ultimate-store-kit'), | |
| 1155 | + 'top-right' => esc_html__('Top Right', 'ultimate-store-kit'), | |
| 1156 | + 'bottom-left' => esc_html__('Bottom Left', 'ultimate-store-kit'), | |
| 1157 | + 'bottom-right' => esc_html__('Bottom Right', 'ultimate-store-kit'), | |
| 1158 | + ], | |
| 1159 | + 'selectors_dictionary' => [ | |
| 1160 | + 'top-left' => 'top: 0; left: 0;', | |
| 1161 | + 'top-right' => 'top: 0; right: 0;', | |
| 1162 | + 'bottom-left' => 'bottom: 0; left: 0;', | |
| 1163 | + 'bottom-right' => 'bottom: 0; right: 0;', | |
| 1164 | + ], | |
| 1165 | + 'selectors' => [ | |
| 1166 | + '{{WRAPPER}} .usk-featured-box .usk-badge' => '{{VALUE}};', | |
| 1167 | + ], | |
| 1168 | + ] | |
| 1169 | + ); | |
| 1170 | + $this->start_controls_tabs('tabs_badge_style'); | |
| 1171 | + $this->start_controls_tab( | |
| 1172 | + 'tab_badge_normal', | |
| 1173 | + [ | |
| 1174 | + 'label' => esc_html__('Normal', 'ultimate-store-kit'), | |
| 1175 | + ] | |
| 1176 | + ); | |
| 1177 | + $this->add_control( | |
| 1178 | + 'badge_color', | |
| 1179 | + [ | |
| 1180 | + 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 1181 | + 'type' => Controls_Manager::COLOR, | |
| 1182 | + 'selectors' => [ | |
| 1183 | + '{{WRAPPER}} .usk-featured-box .usk-badge' => 'color: {{VALUE}};', | |
| 1184 | + ], | |
| 1185 | + ] | |
| 1186 | + ); | |
| 1187 | + $this->add_group_control( | |
| 1188 | + Group_Control_Background::get_type(), | |
| 1189 | + [ | |
| 1190 | + 'name' => 'badge_background', | |
| 1191 | + 'exclude' => ['image'], | |
| 1192 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-badge', | |
| 1193 | + ] | |
| 1194 | + ); | |
| 1195 | + $this->add_group_control( | |
| 1196 | + Group_Control_Border::get_type(), | |
| 1197 | + [ | |
| 1198 | + 'name' => 'badge_border', | |
| 1199 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-badge', | |
| 1200 | + 'separator' => 'before', | |
| 1201 | + ] | |
| 1202 | + ); | |
| 1203 | + $this->add_responsive_control( | |
| 1204 | + 'badge_border_radius', | |
| 1205 | + [ | |
| 1206 | + 'label' => esc_html__('Border Radius', 'ultimate-store-kit'), | |
| 1207 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1208 | + 'size_units' => ['px', '%'], | |
| 1209 | + 'selectors' => [ | |
| 1210 | + '{{WRAPPER}} .usk-featured-box .usk-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1211 | + ], | |
| 1212 | + ] | |
| 1213 | + ); | |
| 1214 | + $this->add_responsive_control( | |
| 1215 | + 'badge_padding', | |
| 1216 | + [ | |
| 1217 | + 'label' => esc_html__('Padding', 'ultimate-store-kit'), | |
| 1218 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1219 | + 'size_units' => ['px', 'em', '%'], | |
| 1220 | + 'selectors' => [ | |
| 1221 | + '{{WRAPPER}} .usk-featured-box .usk-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1222 | + ], | |
| 1223 | + ] | |
| 1224 | + ); | |
| 1225 | + $this->add_responsive_control( | |
| 1226 | + 'badge_margin', | |
| 1227 | + [ | |
| 1228 | + 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 1229 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1230 | + 'size_units' => ['px', 'em', '%'], | |
| 1231 | + 'selectors' => [ | |
| 1232 | + '{{WRAPPER}} .usk-featured-box .usk-badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1233 | + ], | |
| 1234 | + ] | |
| 1235 | + ); | |
| 1236 | + $this->add_group_control( | |
| 1237 | + Group_Control_Typography::get_type(), | |
| 1238 | + [ | |
| 1239 | + 'name' => 'badge_typography', | |
| 1240 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-badge', | |
| 1241 | + ] | |
| 1242 | + ); | |
| 1243 | + $this->add_group_control( | |
| 1244 | + Group_Control_Box_Shadow::get_type(), | |
| 1245 | + [ | |
| 1246 | + 'name' => 'badge_box_shadow', | |
| 1247 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-badge', | |
| 1248 | + ] | |
| 1249 | + ); | |
| 1250 | + $this->add_control( | |
| 1251 | + 'badge_offset_toggle', | |
| 1252 | + [ | |
| 1253 | + 'label' => __('Offset', 'ultimate-store-kit'), | |
| 1254 | + 'type' => Controls_Manager::POPOVER_TOGGLE, | |
| 1255 | + 'label_off' => __('None', 'ultimate-store-kit'), | |
| 1256 | + 'label_on' => __('Custom', 'ultimate-store-kit'), | |
| 1257 | + 'return_value' => 'yes', | |
| 1258 | + ] | |
| 1259 | + ); | |
| 1260 | + $this->start_popover(); | |
| 1261 | + $this->add_responsive_control( | |
| 1262 | + 'badge_x_position', | |
| 1263 | + [ | |
| 1264 | + 'label' => __( 'X', 'ultimate-store-kit' ), | |
| 1265 | + 'type' => Controls_Manager::SLIDER, | |
| 1266 | + 'default' => [ | |
| 1267 | + 'size' => 0, | |
| 1268 | + ], | |
| 1269 | + 'tablet_default' => [ | |
| 1270 | + 'size' => 0, | |
| 1271 | + ], | |
| 1272 | + 'mobile_default' => [ | |
| 1273 | + 'size' => 0, | |
| 1274 | + ], | |
| 1275 | + 'range' => [ | |
| 1276 | + 'px' => [ | |
| 1277 | + 'min' => -800, | |
| 1278 | + 'max' => 800, | |
| 1279 | + ], | |
| 1280 | + ], | |
| 1281 | + 'condition' => [ | |
| 1282 | + 'badge_offset_toggle' => 'yes' | |
| 1283 | + ], | |
| 1284 | + 'render_type' => 'ui', | |
| 1285 | + 'selectors' => [ | |
| 1286 | + '{{WRAPPER}}' => '--usk-badge-x-offset: {{SIZE}}px;' | |
| 1287 | + ], | |
| 1288 | + ] | |
| 1289 | + ); | |
| 1290 | + | |
| 1291 | + $this->add_responsive_control( | |
| 1292 | + 'badge_y_position', | |
| 1293 | + [ | |
| 1294 | + 'label' => __( 'Y', 'ultimate-store-kit' ), | |
| 1295 | + 'type' => Controls_Manager::SLIDER, | |
| 1296 | + 'default' => [ | |
| 1297 | + 'size' => 0, | |
| 1298 | + ], | |
| 1299 | + 'tablet_default' => [ | |
| 1300 | + 'size' => 0, | |
| 1301 | + ], | |
| 1302 | + 'mobile_default' => [ | |
| 1303 | + 'size' => 0, | |
| 1304 | + ], | |
| 1305 | + 'range' => [ | |
| 1306 | + 'px' => [ | |
| 1307 | + 'min' => -800, | |
| 1308 | + 'max' => 800, | |
| 1309 | + ], | |
| 1310 | + ], | |
| 1311 | + 'condition' => [ | |
| 1312 | + 'badge_offset_toggle' => 'yes' | |
| 1313 | + ], | |
| 1314 | + 'render_type' => 'ui', | |
| 1315 | + 'selectors' => [ | |
| 1316 | + '{{WRAPPER}}' => '--usk-badge-y-offset: {{SIZE}}px;' | |
| 1317 | + ], | |
| 1318 | + ] | |
| 1319 | + ); | |
| 1320 | + | |
| 1321 | + $this->add_responsive_control( | |
| 1322 | + 'badge_rotate', | |
| 1323 | + [ | |
| 1324 | + 'label' => __( 'Rotate', 'ultimate-store-kit' ), | |
| 1325 | + 'type' => Controls_Manager::SLIDER, | |
| 1326 | + 'default' => [ | |
| 1327 | + 'size' => 0, | |
| 1328 | + ], | |
| 1329 | + 'tablet_default' => [ | |
| 1330 | + 'size' => 0, | |
| 1331 | + ], | |
| 1332 | + 'mobile_default' => [ | |
| 1333 | + 'size' => 0, | |
| 1334 | + ], | |
| 1335 | + 'range' => [ | |
| 1336 | + 'px' => [ | |
| 1337 | + 'min' => -180, | |
| 1338 | + 'max' => 180, | |
| 1339 | + 'step' => 5, | |
| 1340 | + ], | |
| 1341 | + ], | |
| 1342 | + 'condition' => [ | |
| 1343 | + 'badge_offset_toggle' => 'yes' | |
| 1344 | + ], | |
| 1345 | + 'render_type' => 'ui', | |
| 1346 | + 'selectors' => [ | |
| 1347 | + '{{WRAPPER}}' => '--usk-badge-rotate: {{SIZE}}deg;' | |
| 1348 | + ], | |
| 1349 | + ] | |
| 1350 | + ); | |
| 1351 | + $this->end_popover(); | |
| 1352 | + $this->end_controls_tab(); | |
| 1353 | + $this->start_controls_tab( | |
| 1354 | + 'tab_badge_hover', | |
| 1355 | + [ | |
| 1356 | + 'label' => esc_html__('Hover', 'ultimate-store-kit'), | |
| 1357 | + ] | |
| 1358 | + ); | |
| 1359 | + $this->add_control( | |
| 1360 | + 'badge_hover_color', | |
| 1361 | + [ | |
| 1362 | + 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 1363 | + 'type' => Controls_Manager::COLOR, | |
| 1364 | + 'selectors' => [ | |
| 1365 | + '{{WRAPPER}} .usk-featured-box .usk-badge:hover' => 'color: {{VALUE}};', | |
| 1366 | + ], | |
| 1367 | + ] | |
| 1368 | + ); | |
| 1369 | + $this->add_group_control( | |
| 1370 | + Group_Control_Background::get_type(), | |
| 1371 | + [ | |
| 1372 | + 'name' => 'badge_hover_background', | |
| 1373 | + 'exclude' => ['image'], | |
| 1374 | + 'selector' => '{{WRAPPER}} .usk-featured-box .usk-badge:hover', | |
| 1375 | + ] | |
| 1376 | + ); | |
| 1377 | + $this->add_control( | |
| 1378 | + 'badge_hover_border_color', | |
| 1379 | + [ | |
| 1380 | + 'label' => esc_html__('Border Color', 'ultimate-store-kit'), | |
| 1381 | + 'type' => Controls_Manager::COLOR, | |
| 1382 | + 'condition' => [ | |
| 1383 | + 'badge_border_border!' => '', | |
| 1384 | + ], | |
| 1385 | + 'selectors' => [ | |
| 1386 | + '{{WRAPPER}} .usk-featured-box .usk-badge:hover' => 'border-color: {{VALUE}};', | |
| 1387 | + ], | |
| 1388 | + ] | |
| 1389 | + ); | |
| 1390 | + $this->end_controls_tab(); | |
| 960 | 1391 | $this->end_controls_tabs(); |
| 961 | - | |
| 962 | 1392 | $this->end_controls_section(); |
| 963 | 1393 | } |
| 964 | 1394 | |
| 965 | - | |
| 966 | - public function render_title() | |
| 967 | - { | |
| 1395 | + public function render_title() { | |
| 968 | 1396 | $settings = $this->get_settings_for_display(); |
| 969 | 1397 | |
| 970 | - if (! $settings['show_title']) { | |
| 1398 | + if (!$settings['show_title']) { | |
| 971 | 1399 | return; |
| 972 | 1400 | } |
| 973 | 1401 | |
| 974 | - $this->add_render_attribute( | |
| 975 | - [ | |
| 976 | - 'title-link' => [ | |
| 977 | - 'href' => isset($settings['title_link']['url']) && !empty($settings['title_link']['url']) ? esc_url($settings['title_link']['url']) : 'javascript:void(0);', | |
| 978 | - 'target' => $settings['title_link']['is_external'] ? '_blank' : '_self' | |
| 979 | - ] | |
| 980 | - ], | |
| 981 | - '', | |
| 982 | - '', | |
| 983 | - true | |
| 984 | - ); | |
| 1402 | + if ( ! empty($settings['title_link']['url']) && ! empty($settings['title']) ) { | |
| 1403 | + $this->add_link_attributes('title-link', $settings['title_link'], true); | |
| 1404 | + } | |
| 985 | 1405 | |
| 986 | 1406 | if (!empty($settings['title'])) { |
| 987 | - printf('<%1$s class="usk-title"><a %2$s title="%3$s">%3$s</a></%1$s>', esc_attr($settings['title_tag']), wp_kses_post($this->get_render_attribute_string('title-link')), wp_kses_post($settings['title'])); | |
| 1407 | + printf( | |
| 1408 | + '<%1$s class="usk-title"><a %2$s title="%3$s">%3$s</a></%1$s>', | |
| 1409 | + esc_attr( Utils::get_valid_html_tag($settings['title_tag']) ), | |
| 1410 | + $this->get_render_attribute_string('title-link'), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1411 | + esc_attr($settings['title']) | |
| 1412 | + ); | |
| 988 | 1413 | } |
| 989 | 1414 | } |
| 990 | 1415 | |
| 991 | - public function render_text() | |
| 992 | - { | |
| 1416 | + public function render_text() { | |
| 993 | 1417 | $settings = $this->get_settings_for_display(); |
| 994 | 1418 | |
| 995 | - if (! $settings['show_text']) { | |
| 1419 | + if (!$settings['show_text']) { | |
| 996 | 1420 | return; |
| 997 | 1421 | } |
| 998 | 1422 | |
| 999 | 1423 | ?> |
| 1000 | - <?php if ($settings['text']) : ?> | |
| 1424 | + <?php if ($settings['text']): ?> | |
| 1001 | 1425 | <div class="usk-text"> |
| 1002 | 1426 | <?php echo wp_kses_post($settings['text']); ?> |
| 1003 | 1427 | </div> |
| 1004 | 1428 | <?php endif; |
| @@ -1003,18 +1427,17 @@ | ||
| 1003 | 1427 | </div> |
| 1004 | 1428 | <?php endif; |
| 1005 | 1429 | } |
| 1006 | 1430 | |
| 1007 | - public function render_meta() | |
| 1008 | - { | |
| 1431 | + public function render_meta() { | |
| 1009 | 1432 | $settings = $this->get_settings_for_display(); |
| 1010 | 1433 | |
| 1011 | - if (! $settings['show_meta']) { | |
| 1434 | + if (!$settings['show_meta']) { | |
| 1012 | 1435 | return; |
| 1013 | 1436 | } |
| 1014 | 1437 | |
| 1015 | 1438 | ?> |
| 1016 | - <?php if ($settings['meta']) : ?> | |
| 1439 | + <?php if ($settings['meta']): ?> | |
| 1017 | 1440 | <div class="usk-meta"> |
| 1018 | 1441 | <?php echo wp_kses_post($settings['meta']); ?> |
| 1019 | 1442 | </div> |
| 1020 | 1443 | <?php endif; |
| @@ -1020,91 +1443,72 @@ | ||
| 1020 | 1443 | <?php endif; |
| 1021 | 1444 | } |
| 1022 | 1445 | |
| 1023 | 1446 | public function rendar_image() { |
| 1024 | - $settings = $this->get_settings_for_display(); | |
| 1447 | + $settings = $this->get_settings_for_display(); | |
| 1025 | 1448 | |
| 1026 | - $image_src = Group_Control_Image_Size::get_attachment_image_src($settings['image']['id'], 'thumbnail', $settings); | |
| 1449 | + if (empty($settings['image']['url'])) { | |
| 1450 | + return; | |
| 1451 | + } | |
| 1027 | 1452 | |
| 1028 | - if ($image_src) { | |
| 1029 | - $image_final_src = $image_src; | |
| 1030 | - } elseif ($settings['image']['url']) { | |
| 1031 | - $image_final_src = $settings['image']['url']; | |
| 1032 | - } else { | |
| 1033 | - return; | |
| 1034 | - } | |
| 1035 | - ?> | |
| 1453 | + ?> | |
| 1036 | 1454 | |
| 1037 | - <div class="usk-image-wrap" style="background-image: url('<?php echo esc_url($image_final_src); ?>')"></div> | |
| 1455 | + <div class="usk-image-wrap"></div> | |
| 1038 | 1456 | |
| 1039 | 1457 | <?php |
| 1040 | - } | |
| 1458 | + } | |
| 1041 | 1459 | |
| 1042 | - public function render_readmore() | |
| 1043 | - { | |
| 1460 | + public function render_readmore() { | |
| 1044 | 1461 | $settings = $this->get_settings_for_display(); |
| 1045 | 1462 | |
| 1046 | - if (! $settings['show_readmore']) { | |
| 1463 | + if (!$settings['show_readmore']) { | |
| 1047 | 1464 | return; |
| 1048 | 1465 | } |
| 1049 | 1466 | |
| 1050 | - $this->add_render_attribute( | |
| 1051 | - [ | |
| 1052 | - 'readmore-link' => [ | |
| 1053 | - 'href' => isset($settings['readmore_link']['url']) ? esc_url($settings['readmore_link']['url']) : '#', | |
| 1054 | - 'target' => $settings['readmore_link']['is_external'] ? '_blank' : '_self' | |
| 1055 | - ] | |
| 1056 | - ], | |
| 1057 | - '', | |
| 1058 | - '', | |
| 1059 | - true | |
| 1060 | - ); | |
| 1467 | + if (!empty($settings['readmore_link']['url'])) { | |
| 1468 | + $this->add_link_attributes('readmore-link', $settings['readmore_link'], true); | |
| 1469 | + } | |
| 1061 | 1470 | |
| 1062 | 1471 | ?> |
| 1063 | - <?php if (( ! empty($settings['readmore_link']['url'])) && ( $settings['show_readmore'] )) : ?> | |
| 1472 | + <?php if ((!empty($settings['readmore_link']['url'])) && ($settings['show_readmore'])): ?> | |
| 1064 | 1473 | <div class="usk-link-btn"> |
| 1065 | - <a <?php $this->print_render_attribute_string('readmore-link'); ?>> | |
| 1474 | + <a <?php $this->print_render_attribute_string('readmore-link');?>> | |
| 1066 | 1475 | <span><?php echo esc_html($settings['readmore_text']); ?></span> |
| 1067 | 1476 | </a> |
| 1068 | 1477 | </div> |
| 1069 | - <?php endif; ?> | |
| 1478 | + <?php endif;?> | |
| 1070 | 1479 | <?php |
| 1071 | 1480 | } |
| 1072 | - | |
| 1073 | - protected function render() | |
| 1074 | - { | |
| 1481 | + | |
| 1482 | + protected function render() { | |
| 1075 | 1483 | $settings = $this->get_settings_for_display(); |
| 1076 | - | |
| 1077 | - $this->add_render_attribute('featured-box', 'class', 'usk-featured-box usk-fb-content-position-' . $settings['position']); | |
| 1078 | 1484 | |
| 1079 | - $this->add_render_attribute( | |
| 1080 | - [ | |
| 1081 | - 'link' => [ | |
| 1082 | - 'href' => isset($settings['wrapper_link']['url']) && !empty($settings['wrapper_link']['url']) ? esc_url($settings['wrapper_link']['url']) : 'javascript:void(0);', | |
| 1083 | - 'target' => $settings['show_wrapper_link'] == 'yes' and $settings['wrapper_link']['is_external'] ? '_blank' : '_self' | |
| 1084 | - ] | |
| 1085 | - ], | |
| 1086 | - '', | |
| 1087 | - '', | |
| 1088 | - true | |
| 1089 | - ); | |
| 1485 | + $this->add_render_attribute('featured-box', 'class', 'usk-featured-box usk-fb-content-position-' . $settings['content_position']); | |
| 1090 | 1486 | |
| 1487 | + if (!empty($settings['wrapper_link']['url'])) { | |
| 1488 | + $this->add_link_attributes('link', $settings['wrapper_link'], true); | |
| 1489 | + } | |
| 1490 | + $this->add_render_attribute('link', 'class', 'usk-featured-box-wrapper-link', true); | |
| 1491 | + | |
| 1091 | 1492 | ?> |
| 1092 | - <div <?php $this->print_render_attribute_string('featured-box'); ?>> | |
| 1093 | - | |
| 1094 | - <div class="usk-featured-box-item"> | |
| 1095 | - <?php $this->rendar_image(); ?> | |
| 1493 | + <div <?php $this->print_render_attribute_string('featured-box');?>> | |
| 1494 | + | |
| 1495 | + <div class="usk-item"> | |
| 1496 | + <?php $this->rendar_image();?> | |
| 1096 | 1497 | <div class="usk-content"> |
| 1097 | - <?php $this->render_meta(); ?> | |
| 1098 | - <?php $this->render_title(); ?> | |
| 1099 | - <?php $this->render_text(); ?> | |
| 1100 | - <?php $this->render_readmore(); ?> | |
| 1498 | + <?php $this->render_meta();?> | |
| 1499 | + <?php $this->render_title();?> | |
| 1500 | + <?php $this->render_text();?> | |
| 1501 | + <?php $this->render_readmore();?> | |
| 1101 | 1502 | </div> |
| 1102 | 1503 | </div> |
| 1103 | 1504 | <?php |
| 1104 | - if ($settings['show_wrapper_link'] == 'yes' and !empty($settings['wrapper_link']['url'])) { | |
| 1105 | - printf('<a %1$s class="usk-featured-box-wrapper-link"></a>', wp_kses_post($this->get_render_attribute_string('link'))); | |
| 1106 | - }?> | |
| 1505 | + if ($settings['badge'] == 'yes' and !empty($settings['badge_text'])) { | |
| 1506 | + printf('<div class="usk-badge">%1$s</div>', esc_html($settings['badge_text'])); | |
| 1507 | + } | |
| 1508 | + if ($settings['show_wrapper_link'] == 'yes' and !empty($settings['wrapper_link']['url'])) { ?> | |
| 1509 | + <a <?php $this->print_render_attribute_string('link'); ?>></a> | |
| 1510 | + <?php } ?> | |
| 1107 | 1511 | |
| 1108 | 1512 | </div> |
| 1109 | 1513 | <?php |
| 1110 | 1514 | } |