File tree Expand file tree Collapse file tree 1 file changed +23
-20
lines changed
Expand file tree Collapse file tree 1 file changed +23
-20
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,21 @@ class Elementor_Test_Widget extends \Elementor\Widget_Base {
6262
6363 protected function render() {
6464 $settings = $this->get_settings_for_display();
65+
66+ if ( ! $settings['list'] ) {
67+ return;
68+ }
6569 ?>
6670 <ul >
6771 <?php foreach ( $settings['list'] as $index => $item ) : ?>
6872 <li >
69- <?php
70- if ( ! $item['link']['url'] ) {
71- echo $item['text'];
72- } else {
73- ?>< a href = " <?php echo esc_url( $item['link']['url'] ); ?> " ><?php echo $item[' text']; ?></ a ><?php
74- }
75- ?>
73+ <?php
74+ if ( $item['link']['url'] ) {
75+ ?>< a href = " <?php echo esc_url( $item['link']['url'] ); ?> " ><?php echo $item[' text']; ?></ a ><?php
76+ } else {
77+ echo $item['text'];
78+ }
79+ ?>
7680 </li >
7781 <?php endforeach; ?>
7882 </ul >
@@ -81,22 +85,21 @@ class Elementor_Test_Widget extends \Elementor\Widget_Base {
8185
8286 protected function content_template() {
8387 ?>
84- <ul >
8588 <#
86- if ( settings.list ) {
87- _.each( settings.list, function( item, index ) {
88- #>
89- <li >
90- <# if ( item.link && item.link.url ) { #>
91- <a href =" {{{ item.link.url }}}" >{{{ item.text }}}</a >
92- <# } else { #>
93- {{{ item.text }}}
94- <# } #>
95- </li >
96- <#
97- } );
89+ if ( ! settings.list.length ) {
90+ return;
9891 }
9992 #>
93+ <ul >
94+ <# _.each( settings.list, function( item, index ) { #>
95+ <li >
96+ <# if ( item.link && item.link.url ) { #>
97+ <a href =" {{{ item.link.url }}}" >{{{ item.text }}}</a >
98+ <# } else { #>
99+ {{{ item.text }}}
100+ <# } #>
101+ </li >
102+ <# } ); #>
100103 </ul >
101104 <?php
102105 }
You can’t perform that action at this time.
0 commit comments