PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
← All changes | elementor-elements/classes/wdk-elementor-base.php +114 -26 1.2.6 → 1.5.9 View file →
@@ -29,8 +29,9 @@
29 29 protected $data = array();
30 30 protected $WMVC = NULL;
31 31
32 32 public function __construct($data = array(), $args = null) {
33 +
33 34 /* load icons for tabs in edit mode */
34 35 wp_enqueue_style( 'wdk-elementor-main', WPDIRECTORYKIT_URL. 'elementor-elements/assets/css/wdk-main.css' );
35 36
36 37 if ($this->is_edit_mode_load()) {
@@ -36,8 +37,13 @@
36 37 if ($this->is_edit_mode_load()) {
37 38 $this->enqueue_styles_scripts();
38 39 }
39 40
41 +
42 + $this->WMVC = &wdk_get_instance();
43 + $this->WMVC->model('listingfield_m');
44 + $this->WMVC->model('listing_m');
45 + $this->WMVC->load_helper('listing');
40 46 parent::__construct($data, $args);
41 47 }
42 48
43 49 /**
@@ -161,13 +167,8 @@
161 167 */
162 168 protected function render() {
163 169 $this->enqueue_styles_scripts();
164 170 $this->add_page_settings_css();
165 -
166 - $this->WMVC = &wdk_get_instance();
167 - $this->WMVC->model('listingfield_m');
168 - $this->WMVC->model('listing_m');
169 - $this->WMVC->load_helper('listing');
170 171 }
171 172
172 173
173 174 public function view($view_file = '', $element = NULL, $print = false)
@@ -224,9 +225,10 @@
224 225 case 'text': $enable_options = ['align','typo','color','background','border','border_radius','padding','shadow','transition'];
225 226 break;
226 227 case 'full': $enable_options = ['margin','align','typo','color','background','border','border_radius','padding','shadow','transition'];
227 228 break;
228 - deafult: $enable_options = ['margin','align','typo','color','background','border','border_radius','padding','shadow','transition'];
229 + default: $enable_options = ['margin','align','typo','color','background','border','border_radius','padding','shadow','transition'];
230 +
229 231 break;
230 232 }
231 233 }
232 234
@@ -344,8 +346,77 @@
344 346 'selector' => $selector,
345 347 ]
346 348 );
347 349
350 + if(in_array('outline',$options)) {
351 +
352 + $this->add_responsive_control(
353 + $type.'_outline'.$prefix,
354 + [
355 + 'label' => esc_html_x( 'Outline Type', 'Outline Control', 'wpdirectorykit' ),
356 + 'type' => \Elementor\Controls_Manager::SELECT,
357 + 'options' => [
358 + '' => esc_html__( 'Default', 'wpdirectorykit' ),
359 + 'none' => esc_html__( 'None', 'wpdirectorykit' ),
360 + 'solid' => esc_html_x( 'Solid', 'Outline Control', 'wpdirectorykit' ),
361 + 'double' => esc_html_x( 'Double', 'Outline Control', 'wpdirectorykit' ),
362 + 'dotted' => esc_html_x( 'Dotted', 'Outline Control', 'wpdirectorykit' ),
363 + 'dashed' => esc_html_x( 'Dashed', 'Outline Control', 'wpdirectorykit' ),
364 + 'groove' => esc_html_x( 'Groove', 'Outline Control', 'wpdirectorykit' ),
365 + ],
366 + 'selectors' => [
367 + $selector => 'outline-style: {{VALUE}};',
368 + ],
369 + ]
370 + );
371 +
372 + $this->add_responsive_control(
373 + $type.'_outline_width'.$prefix,
374 + [
375 + 'label' => esc_html_x( 'Width', 'Outline Control', 'wpdirectorykit' ),
376 + 'type' => \Elementor\Controls_Manager::NUMBER,
377 + 'default' => '',
378 + 'selectors' => [
379 + $selector => 'outline-width: {{VALUE}}px;',
380 + ],
381 + 'condition' => [
382 + $type.'_outline'.$prefix.'!' => [ '', 'none' ],
383 + ],
384 + ]
385 + );
386 +
387 + $this->add_responsive_control(
388 + $type.'_outline_color'.$prefix,
389 + [
390 + 'label' => esc_html_x( 'Color', 'Outline Control', 'wpdirectorykit' ),
391 + 'type' => \Elementor\Controls_Manager::COLOR,
392 + 'default' => '',
393 + 'selectors' => [
394 + $selector => 'outline-color: {{VALUE}};',
395 + ],
396 + 'condition' => [
397 + $type.'_outline'.$prefix.'!' => [ '', 'none' ],
398 + ],
399 + ]
400 + );
401 +
402 + $this->add_responsive_control(
403 + $type.'_outline_offset'.$prefix,
404 + [
405 + 'label' => esc_html_x( 'Offset', 'Outline Control', 'wpdirectorykit' ),
406 + 'type' => \Elementor\Controls_Manager::NUMBER,
407 + 'default' => '',
408 + 'selectors' => [
409 + $selector => 'outline-offset: {{VALUE}}px;',
410 + ],
411 + 'condition' => [
412 + $type.'_outline'.$prefix.'!' => [ '', 'none' ],
413 + ],
414 + ]
415 + );
416 +
417 + }
418 +
348 419 if(in_array('border_radius',$options))
349 420 $this->add_responsive_control(
350 421 $type.'_border_radius'.$prefix,
351 422 [
@@ -595,17 +666,17 @@
595 666
596 667 $this->add_control(
597 668 $type.'_image_fit_control'.$prefix,
598 669 [
599 - 'label' => esc_html__( 'Fit', 'textdomain' ),
670 + 'label' => esc_html__( 'Fit', 'wpdirectorykit' ),
600 671 'type' => \Elementor\Controls_Manager::SELECT,
601 672 'options' => [
602 - '' => esc_html__( 'Default', 'textdomain' ),
603 - 'fill' => esc_html__( 'Fill', 'textdomain' ),
604 - 'contain' => esc_html__( 'Contain', 'textdomain' ),
605 - 'cover' => esc_html__( 'Cover', 'textdomain' ),
606 - 'none' => esc_html__( 'None', 'textdomain' ),
607 - 'scale-down' => esc_html__( 'Scale down', 'textdomain' ),
673 + '' => esc_html__( 'Default', 'wpdirectorykit' ),
674 + 'fill' => esc_html__( 'Fill', 'wpdirectorykit' ),
675 + 'contain' => esc_html__( 'Contain', 'wpdirectorykit' ),
676 + 'cover' => esc_html__( 'Cover', 'wpdirectorykit' ),
677 + 'none' => esc_html__( 'None', 'wpdirectorykit' ),
678 + 'scale-down' => esc_html__( 'Scale down', 'wpdirectorykit' ),
608 679 ],
609 680 'selectors' => [
610 681 $selector => 'object-fit: {{VALUE}};',
611 682 ],
@@ -613,17 +684,17 @@
613 684 );
614 685 $this->add_control(
615 686 $type.'_image_fit_control_position'.$prefix,
616 687 [
617 - 'label' => esc_html__( 'Fit Position', 'textdomain' ),
688 + 'label' => esc_html__( 'Fit Position', 'wpdirectorykit' ),
618 689 'type' => \Elementor\Controls_Manager::SELECT,
619 690 'options' => [
620 - '' => esc_html__( 'Default', 'textdomain' ),
621 - 'top' => esc_html__( 'Top', 'textdomain' ),
622 - 'bottom' => esc_html__( 'Bottom', 'textdomain' ),
623 - 'left' => esc_html__( 'Left', 'textdomain' ),
624 - 'right' => esc_html__( 'Right', 'textdomain' ),
625 - 'center' => esc_html__( 'Center', 'textdomain' ),
691 + '' => esc_html__( 'Default', 'wpdirectorykit' ),
692 + 'top' => esc_html__( 'Top', 'wpdirectorykit' ),
693 + 'bottom' => esc_html__( 'Bottom', 'wpdirectorykit' ),
694 + 'left' => esc_html__( 'Left', 'wpdirectorykit' ),
695 + 'right' => esc_html__( 'Right', 'wpdirectorykit' ),
696 + 'center' => esc_html__( 'Center', 'wpdirectorykit' ),
626 697 ],
627 698 'selectors' => [
628 699 $selector => 'object-position: {{VALUE}};',
629 700 ],
@@ -743,8 +814,12 @@
743 814 * @param $post_css Post
744 815 */
745 816 public function add_page_settings_css() {
746 817 $settings = $this->get_settings();
818 +
819 + if(!isset($settings['custom_css']))
820 + return;
821 +
747 822 $custom_css = $settings['custom_css'];
748 823 $custom_css = trim( $custom_css );
749 824
750 825 if ( empty( $custom_css ) ) {
@@ -751,14 +826,16 @@
751 826 return;
752 827 }
753 828
754 829 // Add a css comment
755 - $custom_css = '/* Start custom CSS for page-settings */' . $custom_css . '/* End custom CSS */';
830 + $custom_css_file = '/* Start custom CSS for page-settings */' .
831 + str_replace( 'selector', '#wdk_el_' . $this->get_id_int(), $custom_css ).
832 + str_replace( 'selector', '.elementor-element.elementor-element-' . $this->get_id(), $custom_css ).
833 + '/* End custom CSS */';
756 834
757 -
758 - $custom_css = str_replace( 'selector', '#wdk_el_' . $this->get_id(), $custom_css );
759 835
760 - echo '<style>'.wmvc_xss_clean($custom_css).'</style>';
836 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
837 + echo '<style>'.wmvc_xss_clean($custom_css_file).'</style>';
761 838 }
762 839
763 840 private function break_css($css)
764 841 {
@@ -781,9 +858,9 @@
781 858 }
782 859 $output = '';
783 860 // handler SVG Icon
784 861 if ( 'svg' === $icon['library'] ) {
785 - $output = \Elementor\Icons_Manager::render_svg_icon( $icon['value'] );
862 + $output = \Elementor\Icons_Manager::render_uploaded_svg_icon( $icon['value'] );
786 863 } else {
787 864 $output = $this->render_icon_html( $icon, $attributes, $tag );
788 865 }
789 866
@@ -879,8 +956,9 @@
879 956 ],
880 957 ],
881 958 'default' => '1',
882 959 'toggle' => false,
960 + /* translators: 1: Tag with link open, 2: close link tag. */
883 961 'description' => '<span class="wdk_control_get_pro">'.wdk_sprintf(esc_html__(' %1$sGet our Addons%2$s for more awesome elements and powerful features!','wpdirectorykit'),'<a href="//wpdirectorykit.com/plugins.html" target="_blank">','</a>').'</span>'
884 962
885 963 ]
886 964 );
@@ -888,5 +966,15 @@
888 966 $this->end_controls_section();
889 967 }
890 968 }
891 969
892 -}
970 + public function editing_element($key, $toolbar = 'basic', $attr = array()) {
971 + $this->add_inline_editing_attributes( $key, $toolbar );
972 + foreach ($attr as $key_attr => $value_attr) {
973 + $this->add_render_attribute( $key, $key_attr, $value_attr );
974 + }
975 +
976 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
977 + echo $this->get_render_attribute_string( $key );
978 + }
979 +
980 +}