@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if(!empty($this->options['nested-block'])){ |
61 | 61 | if(empty($this->options['output_types'])){ |
62 | 62 | $this->options['output_types'] = array('shortcode','block'); |
63 | - }elseif (($key = array_search('widget', $this->options['output_types'])) !== false) { |
|
63 | + } elseif (($key = array_search('widget', $this->options['output_types'])) !== false) { |
|
64 | 64 | unset($this->options['output_types'][$key]); |
65 | 65 | } |
66 | 66 | } |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | <?php |
716 | 716 | if(! empty( $insert_shortcode_function )){ |
717 | 717 | echo $insert_shortcode_function; |
718 | - }else{ |
|
718 | + } else{ |
|
719 | 719 | |
720 | 720 | /** |
721 | 721 | * Function for super duper insert shortcode. |
@@ -2206,7 +2206,7 @@ discard block |
||
2206 | 2206 | $p_pl = 'ps-'; |
2207 | 2207 | $p_pr = 'pe-'; |
2208 | 2208 | <?php |
2209 | - }else{ |
|
2209 | + } else{ |
|
2210 | 2210 | ?> |
2211 | 2211 | $aui_bs5 = false; |
2212 | 2212 | $p_ml = 'ml-'; |
@@ -2428,7 +2428,7 @@ discard block |
||
2428 | 2428 | var InnerBlocks = blockEditor.InnerBlocks; |
2429 | 2429 | |
2430 | 2430 | var term_query_type = ''; |
2431 | - var post_type_rest_slugs = <?php if(! empty( $this->arguments ) && isset($this->arguments['post_type']['onchange_rest']['values'])){echo "[".json_encode($this->arguments['post_type']['onchange_rest']['values'])."]";}else{echo "[]";} ?>; |
|
2431 | + var post_type_rest_slugs = <?php if(! empty( $this->arguments ) && isset($this->arguments['post_type']['onchange_rest']['values'])){echo "[".json_encode($this->arguments['post_type']['onchange_rest']['values'])."]";} else{echo "[]";} ?>; |
|
2432 | 2432 | const taxonomies_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
2433 | 2433 | const sort_by_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
2434 | 2434 | const MediaUpload = wp.blockEditor.MediaUpload; |
@@ -2547,8 +2547,7 @@ discard block |
||
2547 | 2547 | |
2548 | 2548 | if ( $args['type'] == 'notice' || $args['type'] == 'tab' ) { |
2549 | 2549 | continue; |
2550 | - } |
|
2551 | - elseif ( $args['type'] == 'checkbox' ) { |
|
2550 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
2552 | 2551 | $type = 'boolean'; |
2553 | 2552 | $default = isset( $args['default'] ) && $args['default'] ? 'true' : 'false'; |
2554 | 2553 | } elseif ( $args['type'] == 'number' ) { |
@@ -2676,7 +2675,7 @@ discard block |
||
2676 | 2675 | <?php |
2677 | 2676 | if(!empty($this->options['block-edit-raw'])) { |
2678 | 2677 | echo $this->options['block-edit-raw']; // strings have to be in single quotes, may cause issues |
2679 | - }else{ |
|
2678 | + } else{ |
|
2680 | 2679 | ?> |
2681 | 2680 | |
2682 | 2681 | function hasSelectedInnerBlock(props) { |
@@ -2811,7 +2810,7 @@ discard block |
||
2811 | 2810 | $current_screen = function_exists('get_current_screen') ? get_current_screen() : ''; |
2812 | 2811 | if(!empty($current_screen->base) && $current_screen->base==='widgets'){ |
2813 | 2812 | echo 'const { deviceType } = "";'; |
2814 | -}else{ |
|
2813 | +} else{ |
|
2815 | 2814 | ?> |
2816 | 2815 | /** Get device type const. */ |
2817 | 2816 | const { deviceType } = wp.data.useSelect != 'undefined' ? wp.data.useSelect(select => { |
@@ -2845,7 +2844,7 @@ discard block |
||
2845 | 2844 | 'block_parent_name': parentBlocks.length ? parentBlocks[parentBlocks.length - 1].name : '', |
2846 | 2845 | 'post_id': <?php global $post; if ( isset( $post->ID ) ) { |
2847 | 2846 | echo $post->ID; |
2848 | - }else{echo '0';}?>, |
|
2847 | + } else{echo '0';}?>, |
|
2849 | 2848 | '_ajax_nonce': '<?php echo wp_create_nonce( 'super_duper_output_shortcode' );?>' |
2850 | 2849 | }; |
2851 | 2850 | |
@@ -2865,7 +2864,7 @@ discard block |
||
2865 | 2864 | is_fetching = false; |
2866 | 2865 | prev_attributes[props.clientId] = props.attributes; |
2867 | 2866 | <?php |
2868 | - }else{ |
|
2867 | + } else{ |
|
2869 | 2868 | ?> |
2870 | 2869 | props.setAttributes({content: env}); |
2871 | 2870 | is_fetching = false; |
@@ -3023,7 +3022,7 @@ discard block |
||
3023 | 3022 | // |
3024 | 3023 | |
3025 | 3024 | } |
3026 | - }else { |
|
3025 | + } else { |
|
3027 | 3026 | ?> |
3028 | 3027 | el(wp.components.PanelBody, { |
3029 | 3028 | title: '<?php esc_attr_e( "Settings" ); ?>', |
@@ -3049,9 +3048,9 @@ discard block |
||
3049 | 3048 | // If the user sets block-output array then build it |
3050 | 3049 | if ( ! empty( $this->options['block-output'] ) ) { |
3051 | 3050 | $this->block_element( $this->options['block-output'] ); |
3052 | - }elseif(!empty($this->options['block-edit-return'])){ |
|
3051 | + } elseif(!empty($this->options['block-edit-return'])){ |
|
3053 | 3052 | echo $this->options['block-edit-return']; |
3054 | - }else{ |
|
3053 | + } else{ |
|
3055 | 3054 | // if no block-output is set then we try and get the shortcode html output via ajax. |
3056 | 3055 | $block_edit_wrap_tag = !empty($this->options['block_edit_wrap_tag']) ? esc_attr($this->options['block_edit_wrap_tag']) : 'div'; |
3057 | 3056 | ?> |
@@ -3156,9 +3155,9 @@ discard block |
||
3156 | 3155 | ); |
3157 | 3156 | <?php |
3158 | 3157 | |
3159 | - }elseif(!empty($this->options['block-save-return'])){ |
|
3158 | + } elseif(!empty($this->options['block-save-return'])){ |
|
3160 | 3159 | echo 'return ' . $this->options['block-save-return']; |
3161 | - }elseif(!empty($this->options['nested-block'])){ |
|
3160 | + } elseif(!empty($this->options['nested-block'])){ |
|
3162 | 3161 | ?> |
3163 | 3162 | return el( |
3164 | 3163 | '', |
@@ -3168,13 +3167,13 @@ discard block |
||
3168 | 3167 | el('', {dangerouslySetInnerHTML: {__html: "[/<?php echo $this->options['base_id'];?>]"}}) |
3169 | 3168 | ); |
3170 | 3169 | <?php |
3171 | - }elseif(!empty( $this->options['block-save-return'] ) ){ |
|
3170 | + } elseif(!empty( $this->options['block-save-return'] ) ){ |
|
3172 | 3171 | echo "return ". $this->options['block-edit-return'].";"; |
3173 | - }elseif(isset( $this->options['block-wrap'] ) && $this->options['block-wrap'] == ''){ |
|
3172 | + } elseif(isset( $this->options['block-wrap'] ) && $this->options['block-wrap'] == ''){ |
|
3174 | 3173 | ?> |
3175 | 3174 | return content; |
3176 | 3175 | <?php |
3177 | - }else{ |
|
3176 | + } else{ |
|
3178 | 3177 | ?> |
3179 | 3178 | var block_wrap = 'div'; |
3180 | 3179 | if (attr.hasOwnProperty("block_wrap")) { |
@@ -3225,9 +3224,9 @@ discard block |
||
3225 | 3224 | $device_type_icon = ''; |
3226 | 3225 | if($device_type=='Desktop'){ |
3227 | 3226 | $device_type_icon = '<span class="dashicons dashicons-desktop" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3228 | - }elseif($device_type=='Tablet'){ |
|
3227 | + } elseif($device_type=='Tablet'){ |
|
3229 | 3228 | $device_type_icon = '<span class="dashicons dashicons-tablet" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3230 | - }elseif($device_type=='Mobile'){ |
|
3229 | + } elseif($device_type=='Mobile'){ |
|
3231 | 3230 | $device_type_icon = '<span class="dashicons dashicons-smartphone" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3232 | 3231 | } |
3233 | 3232 | echo $element_require; |
@@ -3272,7 +3271,7 @@ discard block |
||
3272 | 3271 | |
3273 | 3272 | <?php |
3274 | 3273 | if(false){?></script><?php } |
3275 | - }elseif(!empty($args['row']['close'])){ |
|
3274 | + } elseif(!empty($args['row']['close'])){ |
|
3276 | 3275 | if(false){?><script><?php }?> |
3277 | 3276 | el( |
3278 | 3277 | 'div', |
@@ -3281,7 +3280,7 @@ discard block |
||
3281 | 3280 | }, |
3282 | 3281 | <?php |
3283 | 3282 | if(false){?></script><?php } |
3284 | - }else{ |
|
3283 | + } else{ |
|
3285 | 3284 | if(false){?><script><?php }?> |
3286 | 3285 | el( |
3287 | 3286 | 'div', |
@@ -3386,9 +3385,9 @@ discard block |
||
3386 | 3385 | $device_type_icon = ''; |
3387 | 3386 | if($device_type=='Desktop'){ |
3388 | 3387 | $device_type_icon = '<span class="dashicons dashicons-desktop" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3389 | - }elseif($device_type=='Tablet'){ |
|
3388 | + } elseif($device_type=='Tablet'){ |
|
3390 | 3389 | $device_type_icon = '<span class="dashicons dashicons-tablet" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3391 | - }elseif($device_type=='Mobile'){ |
|
3390 | + } elseif($device_type=='Mobile'){ |
|
3392 | 3391 | $device_type_icon = '<span class="dashicons dashicons-smartphone" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3393 | 3392 | } |
3394 | 3393 | |
@@ -3445,7 +3444,7 @@ discard block |
||
3445 | 3444 | $args['type'] == 'text'; |
3446 | 3445 | // Save numbers as numbers and not strings |
3447 | 3446 | $value = "props.attributes.$key ? props.attributes.$key : ''"; |
3448 | - }else if ( $args['type'] == 'notice' ) { |
|
3447 | + } else if ( $args['type'] == 'notice' ) { |
|
3449 | 3448 | |
3450 | 3449 | $notice_message = !empty($args['desc']) ? addslashes($args['desc']) : ''; |
3451 | 3450 | $notice_status = !empty($args['status']) ? esc_attr($args['status']) : 'info'; |
@@ -3520,10 +3519,10 @@ discard block |
||
3520 | 3519 | $key: value |
3521 | 3520 | }); |
3522 | 3521 | },"; |
3523 | - }elseif ( $args['type'] == 'gradient' ) { |
|
3522 | + } elseif ( $args['type'] == 'gradient' ) { |
|
3524 | 3523 | $type = 'GradientPicker'; |
3525 | 3524 | |
3526 | - }elseif ( $args['type'] == 'image' ) { |
|
3525 | + } elseif ( $args['type'] == 'image' ) { |
|
3527 | 3526 | // print_r($args); |
3528 | 3527 | |
3529 | 3528 | $img_preview = isset($args['focalpoint']) && !$args['focalpoint'] ? " props.attributes.$key && el('img', { src: props.attributes.$key,style: {maxWidth:'100%',background: '#ccc'}})," : " ( props.attributes.$key || props.attributes.{$key}_use_featured ) && el(wp.components.FocalPointPicker,{ |
@@ -3585,7 +3584,7 @@ discard block |
||
3585 | 3584 | $onchange = ""; |
3586 | 3585 | |
3587 | 3586 | //$inside_elements = ",el('div',{},'file upload')"; |
3588 | - }elseif ( $args['type'] == 'images' ) { |
|
3587 | + } elseif ( $args['type'] == 'images' ) { |
|
3589 | 3588 | // print_r($args); |
3590 | 3589 | |
3591 | 3590 | $img_preview = "props.attributes.$key && (function() { |
@@ -3670,8 +3669,7 @@ discard block |
||
3670 | 3669 | $onchange = ""; |
3671 | 3670 | |
3672 | 3671 | //$inside_elements = ",el('div',{},'file upload')"; |
3673 | - } |
|
3674 | - elseif ( $args['type'] == 'checkbox' ) { |
|
3672 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
3675 | 3673 | $type = 'CheckboxControl'; |
3676 | 3674 | $extra .= "checked: props.attributes.$key,"; |
3677 | 3675 | $onchange = "props.setAttributes({ $key: ! props.attributes.$key } )"; |
@@ -3683,9 +3681,9 @@ discard block |
||
3683 | 3681 | |
3684 | 3682 | if($args['name'] == 'category' && !empty($args['post_type_linked'])){ |
3685 | 3683 | $options .= "options: taxonomies_".str_replace("-","_", $this->id).","; |
3686 | - }elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
3684 | + } elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
3687 | 3685 | $options .= "options: sort_by_".str_replace("-","_", $this->id).","; |
3688 | - }else { |
|
3686 | + } else { |
|
3689 | 3687 | |
3690 | 3688 | if ( ! empty( $args['options'] ) ) { |
3691 | 3689 | $options .= "options: ["; |
@@ -3812,7 +3810,7 @@ discard block |
||
3812 | 3810 | label: <?php |
3813 | 3811 | if(empty($args['title'])){ |
3814 | 3812 | echo "''"; |
3815 | - }elseif(empty($args['row']) && !empty($args['device_type'])){ |
|
3813 | + } elseif(empty($args['row']) && !empty($args['device_type'])){ |
|
3816 | 3814 | ?>el('label', { |
3817 | 3815 | className: 'components-base-control__label', |
3818 | 3816 | style: {width:"100%"} |
@@ -3827,7 +3825,7 @@ discard block |
||
3827 | 3825 | |
3828 | 3826 | )<?php |
3829 | 3827 | |
3830 | - }else{ |
|
3828 | + } else{ |
|
3831 | 3829 | ?>'<?php echo addslashes( $args['title'] ); ?>'<?php |
3832 | 3830 | |
3833 | 3831 | } |
@@ -3835,7 +3833,7 @@ discard block |
||
3835 | 3833 | ?>, |
3836 | 3834 | help: <?php if ( isset( $args['desc'] ) ) { |
3837 | 3835 | echo "el('span',{dangerouslySetInnerHTML: {__html: '".wp_kses_post( addslashes($args['desc']) )."'}})"; |
3838 | - }else{ echo "''"; } ?>, |
|
3836 | + } else{ echo "''"; } ?>, |
|
3839 | 3837 | value: <?php echo $value; ?>, |
3840 | 3838 | <?php if ( $type == 'TextControl' && $args['type'] != 'text' ) { |
3841 | 3839 | echo "type: '" . addslashes( $args['type'] ) . "',"; |
@@ -3875,7 +3873,7 @@ discard block |
||
3875 | 3873 | foreach ( $custom_attributes as $key => $val ) { |
3876 | 3874 | if(is_array($val)){ |
3877 | 3875 | $attributes .= $key.': {'.$this->array_to_attributes( $val, $html ).'},'; |
3878 | - }else{ |
|
3876 | + } else{ |
|
3879 | 3877 | $attributes .= $html ? " $key='$val' " : "'$key': '$val',"; |
3880 | 3878 | } |
3881 | 3879 | } |
@@ -3915,7 +3913,7 @@ discard block |
||
3915 | 3913 | |
3916 | 3914 | if($new_args['element']=='InnerBlocks'){ |
3917 | 3915 | echo "\n el( InnerBlocks, {"; |
3918 | - }elseif($new_args['element']=='innerBlocksProps'){ |
|
3916 | + } elseif($new_args['element']=='innerBlocksProps'){ |
|
3919 | 3917 | $element = isset($new_args['inner_element']) ? esc_attr($new_args['inner_element']) : 'div'; |
3920 | 3918 | // echo "\n el( 'section', wp.blockEditor.useInnerBlocksProps( blockProps, {"; |
3921 | 3919 | // echo $save ? "\n el( '$element', wp.blockEditor.useInnerBlocksProps.save( " : "\n el( '$element', wp.blockEditor.useInnerBlocksProps( "; |
@@ -3928,11 +3926,11 @@ discard block |
||
3928 | 3926 | // echo '###'; |
3929 | 3927 | |
3930 | 3928 | // echo '###'; |
3931 | - }elseif($new_args['element']=='BlocksProps'){ |
|
3929 | + } elseif($new_args['element']=='BlocksProps'){ |
|
3932 | 3930 | |
3933 | 3931 | if ( isset($new_args['if_inner_element']) ) { |
3934 | 3932 | $element = $new_args['if_inner_element']; |
3935 | - }else { |
|
3933 | + } else { |
|
3936 | 3934 | $element = isset($new_args['inner_element']) ? "'".esc_attr($new_args['inner_element'])."'" : "'div'"; |
3937 | 3935 | } |
3938 | 3936 | |
@@ -3943,7 +3941,7 @@ discard block |
||
3943 | 3941 | |
3944 | 3942 | // echo "} ),"; |
3945 | 3943 | |
3946 | - }else{ |
|
3944 | + } else{ |
|
3947 | 3945 | echo "\n el( '" . $new_args['element'] . "', {"; |
3948 | 3946 | } |
3949 | 3947 | |
@@ -3968,7 +3966,7 @@ discard block |
||
3968 | 3966 | |
3969 | 3967 | if ( $new_key === 'content' ) { |
3970 | 3968 | echo "'" . $this->block_props_replace( wp_slash( $new_value ) ) . "'"; |
3971 | - }else if ( $new_key === 'if_content' ) { |
|
3969 | + } else if ( $new_key === 'if_content' ) { |
|
3972 | 3970 | echo $this->block_props_replace( $new_value ); |
3973 | 3971 | } |
3974 | 3972 | |
@@ -3998,7 +3996,7 @@ discard block |
||
3998 | 3996 | |
3999 | 3997 | if($new_args['element']=='innerBlocksProps' || $new_args['element']=='xBlocksProps'){ |
4000 | 3998 | echo "))";// end content |
4001 | - }else{ |
|
3999 | + } else{ |
|
4002 | 4000 | echo ")";// end content |
4003 | 4001 | } |
4004 | 4002 | |
@@ -4284,7 +4282,7 @@ discard block |
||
4284 | 4282 | |
4285 | 4283 | if(empty($instance['widget_title_tag'])){ |
4286 | 4284 | $output = $args['before_title'] . $title . $args['after_title']; |
4287 | - }else{ |
|
4285 | + } else{ |
|
4288 | 4286 | $title_tag = esc_attr( $instance['widget_title_tag'] ); |
4289 | 4287 | |
4290 | 4288 | // classes |
@@ -4389,9 +4387,9 @@ discard block |
||
4389 | 4387 | <div class='row <?php if(!empty($args['row']['class'])){ echo esc_attr($args['row']['class']);} ?>'> |
4390 | 4388 | <div class='col pr-2'> |
4391 | 4389 | <?php |
4392 | - }elseif(!empty($args['row']['close'])){ |
|
4390 | + } elseif(!empty($args['row']['close'])){ |
|
4393 | 4391 | echo "<div class='col pl-0 ps-0'>"; |
4394 | - }else{ |
|
4392 | + } else{ |
|
4395 | 4393 | echo "<div class='col pl-0 ps-0 pr-2 pe-2'>"; |
4396 | 4394 | } |
4397 | 4395 | } |
@@ -4569,11 +4567,11 @@ discard block |
||
4569 | 4567 | public function get_widget_icon($icon = 'box-top', $title = ''){ |
4570 | 4568 | if($icon=='box-top'){ |
4571 | 4569 | return '<svg title="'.esc_attr($title).'" width="20px" height="20px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414" role="img" aria-hidden="true" focusable="false"><rect x="2.714" y="5.492" width="1.048" height="9.017" fill="#555D66"></rect><rect x="16.265" y="5.498" width="1.023" height="9.003" fill="#555D66"></rect><rect x="5.518" y="2.186" width="8.964" height="2.482" fill="#272B2F"></rect><rect x="5.487" y="16.261" width="9.026" height="1.037" fill="#555D66"></rect></svg>'; |
4572 | - }elseif($icon=='box-right'){ |
|
4570 | + } elseif($icon=='box-right'){ |
|
4573 | 4571 | return '<svg title="'.esc_attr($title).'" width="20px" height="20px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414" role="img" aria-hidden="true" focusable="false"><rect x="2.714" y="5.492" width="1.046" height="9.017" fill="#555D66"></rect><rect x="15.244" y="5.498" width="2.518" height="9.003" fill="#272B2F"></rect><rect x="5.518" y="2.719" width="8.964" height="0.954" fill="#555D66"></rect><rect x="5.487" y="16.308" width="9.026" height="0.99" fill="#555D66"></rect></svg>'; |
4574 | - }elseif($icon=='box-bottom'){ |
|
4572 | + } elseif($icon=='box-bottom'){ |
|
4575 | 4573 | return '<svg title="'.esc_attr($title).'" width="20px" height="20px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414" role="img" aria-hidden="true" focusable="false"><rect x="2.714" y="5.492" width="1" height="9.017" fill="#555D66"></rect><rect x="16.261" y="5.498" width="1.027" height="9.003" fill="#555D66"></rect><rect x="5.518" y="2.719" width="8.964" height="0.968" fill="#555D66"></rect><rect x="5.487" y="15.28" width="9.026" height="2.499" fill="#272B2F"></rect></svg>'; |
4576 | - }elseif($icon=='box-left'){ |
|
4574 | + } elseif($icon=='box-left'){ |
|
4577 | 4575 | return '<svg title="'.esc_attr($title).'" width="20px" height="20px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414" role="img" aria-hidden="true" focusable="false"><rect x="2.202" y="5.492" width="2.503" height="9.017" fill="#272B2F"></rect><rect x="16.276" y="5.498" width="1.012" height="9.003" fill="#555D66"></rect><rect x="5.518" y="2.719" width="8.964" height="0.966" fill="#555D66"></rect><rect x="5.487" y="16.303" width="9.026" height="0.995" fill="#555D66"></rect></svg>'; |
4578 | 4576 | } |
4579 | 4577 | } |