@@ -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. |
@@ -2057,7 +2057,7 @@ discard block |
||
2057 | 2057 | $p_pl = 'ps-'; |
2058 | 2058 | $p_pr = 'pe-'; |
2059 | 2059 | <?php |
2060 | - }else{ |
|
2060 | + } else{ |
|
2061 | 2061 | ?> |
2062 | 2062 | $aui_bs5 = false; |
2063 | 2063 | $p_ml = 'ml-'; |
@@ -2279,7 +2279,7 @@ discard block |
||
2279 | 2279 | var InnerBlocks = blockEditor.InnerBlocks; |
2280 | 2280 | |
2281 | 2281 | var term_query_type = ''; |
2282 | - 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 "[]";} ?>; |
|
2282 | + 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 "[]";} ?>; |
|
2283 | 2283 | const taxonomies_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
2284 | 2284 | const sort_by_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
2285 | 2285 | const MediaUpload = wp.blockEditor.MediaUpload; |
@@ -2398,8 +2398,7 @@ discard block |
||
2398 | 2398 | |
2399 | 2399 | if ( $args['type'] == 'notice' || $args['type'] == 'tab' ) { |
2400 | 2400 | continue; |
2401 | - } |
|
2402 | - elseif ( $args['type'] == 'checkbox' ) { |
|
2401 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
2403 | 2402 | $type = 'boolean'; |
2404 | 2403 | $default = isset( $args['default'] ) && $args['default'] ? 'true' : 'false'; |
2405 | 2404 | } elseif ( $args['type'] == 'number' ) { |
@@ -2527,7 +2526,7 @@ discard block |
||
2527 | 2526 | <?php |
2528 | 2527 | if(!empty($this->options['block-edit-raw'])) { |
2529 | 2528 | echo $this->options['block-edit-raw']; // strings have to be in single quotes, may cause issues |
2530 | - }else{ |
|
2529 | + } else{ |
|
2531 | 2530 | ?> |
2532 | 2531 | |
2533 | 2532 | function hasSelectedInnerBlock(props) { |
@@ -2662,7 +2661,7 @@ discard block |
||
2662 | 2661 | $current_screen = function_exists('get_current_screen') ? get_current_screen() : ''; |
2663 | 2662 | if(!empty($current_screen->base) && $current_screen->base==='widgets'){ |
2664 | 2663 | echo 'const { deviceType } = "";'; |
2665 | -}else{ |
|
2664 | +} else{ |
|
2666 | 2665 | ?> |
2667 | 2666 | /** Get device type const. */ |
2668 | 2667 | const { deviceType } = wp.data.useSelect != 'undefined' ? wp.data.useSelect(select => { |
@@ -2696,7 +2695,7 @@ discard block |
||
2696 | 2695 | 'block_parent_name': parentBlocks.length ? parentBlocks[parentBlocks.length - 1].name : '', |
2697 | 2696 | 'post_id': <?php global $post; if ( isset( $post->ID ) ) { |
2698 | 2697 | echo $post->ID; |
2699 | - }else{echo '0';}?>, |
|
2698 | + } else{echo '0';}?>, |
|
2700 | 2699 | '_ajax_nonce': '<?php echo wp_create_nonce( 'super_duper_output_shortcode' );?>' |
2701 | 2700 | }; |
2702 | 2701 | |
@@ -2716,7 +2715,7 @@ discard block |
||
2716 | 2715 | is_fetching = false; |
2717 | 2716 | prev_attributes[props.clientId] = props.attributes; |
2718 | 2717 | <?php |
2719 | - }else{ |
|
2718 | + } else{ |
|
2720 | 2719 | ?> |
2721 | 2720 | props.setAttributes({content: env}); |
2722 | 2721 | is_fetching = false; |
@@ -2876,7 +2875,7 @@ discard block |
||
2876 | 2875 | // |
2877 | 2876 | |
2878 | 2877 | } |
2879 | - }else { |
|
2878 | + } else { |
|
2880 | 2879 | ?> |
2881 | 2880 | el(wp.components.PanelBody, { |
2882 | 2881 | title: '<?php esc_attr_e( "Settings" ); ?>', |
@@ -2902,9 +2901,9 @@ discard block |
||
2902 | 2901 | // If the user sets block-output array then build it |
2903 | 2902 | if ( ! empty( $this->options['block-output'] ) ) { |
2904 | 2903 | $this->block_element( $this->options['block-output'] ); |
2905 | - }elseif(!empty($this->options['block-edit-return'])){ |
|
2904 | + } elseif(!empty($this->options['block-edit-return'])){ |
|
2906 | 2905 | echo $this->options['block-edit-return']; |
2907 | - }else{ |
|
2906 | + } else{ |
|
2908 | 2907 | // if no block-output is set then we try and get the shortcode html output via ajax. |
2909 | 2908 | $block_edit_wrap_tag = !empty($this->options['block_edit_wrap_tag']) ? esc_attr($this->options['block_edit_wrap_tag']) : 'div'; |
2910 | 2909 | ?> |
@@ -3009,9 +3008,9 @@ discard block |
||
3009 | 3008 | ); |
3010 | 3009 | <?php |
3011 | 3010 | |
3012 | - }elseif(!empty($this->options['block-save-return'])){ |
|
3011 | + } elseif(!empty($this->options['block-save-return'])){ |
|
3013 | 3012 | echo 'return ' . $this->options['block-save-return']; |
3014 | - }elseif(!empty($this->options['nested-block'])){ |
|
3013 | + } elseif(!empty($this->options['nested-block'])){ |
|
3015 | 3014 | ?> |
3016 | 3015 | return el( |
3017 | 3016 | '', |
@@ -3021,13 +3020,13 @@ discard block |
||
3021 | 3020 | el('', {dangerouslySetInnerHTML: {__html: "[/<?php echo $this->options['base_id'];?>]"}}) |
3022 | 3021 | ); |
3023 | 3022 | <?php |
3024 | - }elseif(!empty( $this->options['block-save-return'] ) ){ |
|
3023 | + } elseif(!empty( $this->options['block-save-return'] ) ){ |
|
3025 | 3024 | echo "return ". $this->options['block-edit-return'].";"; |
3026 | - }elseif(isset( $this->options['block-wrap'] ) && $this->options['block-wrap'] == ''){ |
|
3025 | + } elseif(isset( $this->options['block-wrap'] ) && $this->options['block-wrap'] == ''){ |
|
3027 | 3026 | ?> |
3028 | 3027 | return content; |
3029 | 3028 | <?php |
3030 | - }else{ |
|
3029 | + } else{ |
|
3031 | 3030 | ?> |
3032 | 3031 | var block_wrap = 'div'; |
3033 | 3032 | if (attr.hasOwnProperty("block_wrap")) { |
@@ -3078,9 +3077,9 @@ discard block |
||
3078 | 3077 | $device_type_icon = ''; |
3079 | 3078 | if($device_type=='Desktop'){ |
3080 | 3079 | $device_type_icon = '<span class="dashicons dashicons-desktop" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3081 | - }elseif($device_type=='Tablet'){ |
|
3080 | + } elseif($device_type=='Tablet'){ |
|
3082 | 3081 | $device_type_icon = '<span class="dashicons dashicons-tablet" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3083 | - }elseif($device_type=='Mobile'){ |
|
3082 | + } elseif($device_type=='Mobile'){ |
|
3084 | 3083 | $device_type_icon = '<span class="dashicons dashicons-smartphone" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3085 | 3084 | } |
3086 | 3085 | echo $element_require; |
@@ -3125,7 +3124,7 @@ discard block |
||
3125 | 3124 | |
3126 | 3125 | <?php |
3127 | 3126 | if(false){?></script><?php } |
3128 | - }elseif(!empty($args['row']['close'])){ |
|
3127 | + } elseif(!empty($args['row']['close'])){ |
|
3129 | 3128 | if(false){?><script><?php }?> |
3130 | 3129 | el( |
3131 | 3130 | 'div', |
@@ -3134,7 +3133,7 @@ discard block |
||
3134 | 3133 | }, |
3135 | 3134 | <?php |
3136 | 3135 | if(false){?></script><?php } |
3137 | - }else{ |
|
3136 | + } else{ |
|
3138 | 3137 | if(false){?><script><?php }?> |
3139 | 3138 | el( |
3140 | 3139 | 'div', |
@@ -3239,9 +3238,9 @@ discard block |
||
3239 | 3238 | $device_type_icon = ''; |
3240 | 3239 | if($device_type=='Desktop'){ |
3241 | 3240 | $device_type_icon = '<span class="dashicons dashicons-desktop" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3242 | - }elseif($device_type=='Tablet'){ |
|
3241 | + } elseif($device_type=='Tablet'){ |
|
3243 | 3242 | $device_type_icon = '<span class="dashicons dashicons-tablet" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3244 | - }elseif($device_type=='Mobile'){ |
|
3243 | + } elseif($device_type=='Mobile'){ |
|
3245 | 3244 | $device_type_icon = '<span class="dashicons dashicons-smartphone" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3246 | 3245 | } |
3247 | 3246 | |
@@ -3298,7 +3297,7 @@ discard block |
||
3298 | 3297 | $args['type'] == 'text'; |
3299 | 3298 | // Save numbers as numbers and not strings |
3300 | 3299 | $value = "props.attributes.$key ? props.attributes.$key : ''"; |
3301 | - }else if ( $args['type'] == 'notice' ) { |
|
3300 | + } else if ( $args['type'] == 'notice' ) { |
|
3302 | 3301 | |
3303 | 3302 | $notice_message = !empty($args['desc']) ? addslashes($args['desc']) : ''; |
3304 | 3303 | $notice_status = !empty($args['status']) ? esc_attr($args['status']) : 'info'; |
@@ -3373,10 +3372,10 @@ discard block |
||
3373 | 3372 | $key: value |
3374 | 3373 | }); |
3375 | 3374 | },"; |
3376 | - }elseif ( $args['type'] == 'gradient' ) { |
|
3375 | + } elseif ( $args['type'] == 'gradient' ) { |
|
3377 | 3376 | $type = 'GradientPicker'; |
3378 | 3377 | |
3379 | - }elseif ( $args['type'] == 'image' ) { |
|
3378 | + } elseif ( $args['type'] == 'image' ) { |
|
3380 | 3379 | // print_r($args); |
3381 | 3380 | |
3382 | 3381 | $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,{ |
@@ -3438,7 +3437,7 @@ discard block |
||
3438 | 3437 | $onchange = ""; |
3439 | 3438 | |
3440 | 3439 | //$inside_elements = ",el('div',{},'file upload')"; |
3441 | - }elseif ( $args['type'] == 'images' ) { |
|
3440 | + } elseif ( $args['type'] == 'images' ) { |
|
3442 | 3441 | // print_r($args); |
3443 | 3442 | |
3444 | 3443 | $img_preview = "props.attributes.$key && (function() { |
@@ -3523,8 +3522,7 @@ discard block |
||
3523 | 3522 | $onchange = ""; |
3524 | 3523 | |
3525 | 3524 | //$inside_elements = ",el('div',{},'file upload')"; |
3526 | - } |
|
3527 | - elseif ( $args['type'] == 'checkbox' ) { |
|
3525 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
3528 | 3526 | $type = 'CheckboxControl'; |
3529 | 3527 | $extra .= "checked: props.attributes.$key,"; |
3530 | 3528 | $onchange = "props.setAttributes({ $key: ! props.attributes.$key } )"; |
@@ -3536,9 +3534,9 @@ discard block |
||
3536 | 3534 | |
3537 | 3535 | if($args['name'] == 'category' && !empty($args['post_type_linked'])){ |
3538 | 3536 | $options .= "options: taxonomies_".str_replace("-","_", $this->id).","; |
3539 | - }elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
3537 | + } elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
3540 | 3538 | $options .= "options: sort_by_".str_replace("-","_", $this->id).","; |
3541 | - }else { |
|
3539 | + } else { |
|
3542 | 3540 | |
3543 | 3541 | if ( ! empty( $args['options'] ) ) { |
3544 | 3542 | $options .= "options: ["; |
@@ -3602,7 +3600,7 @@ discard block |
||
3602 | 3600 | |
3603 | 3601 | } elseif ( $args['type'] == 'alignment' ) { |
3604 | 3602 | $type = 'AlignmentToolbar'; // @todo this does not seem to work but cant find a example |
3605 | - }elseif ( $args['type'] == 'margins' ) { |
|
3603 | + } elseif ( $args['type'] == 'margins' ) { |
|
3606 | 3604 | |
3607 | 3605 | } else { |
3608 | 3606 | return;// if we have not implemented the control then don't break the JS. |
@@ -3632,7 +3630,7 @@ discard block |
||
3632 | 3630 | label: <?php |
3633 | 3631 | if(empty($args['title'])){ |
3634 | 3632 | echo "''"; |
3635 | - }elseif(empty($args['row']) && !empty($args['device_type'])){ |
|
3633 | + } elseif(empty($args['row']) && !empty($args['device_type'])){ |
|
3636 | 3634 | ?>el('label', { |
3637 | 3635 | className: 'components-base-control__label', |
3638 | 3636 | style: {width:"100%"} |
@@ -3647,7 +3645,7 @@ discard block |
||
3647 | 3645 | |
3648 | 3646 | )<?php |
3649 | 3647 | |
3650 | - }else{ |
|
3648 | + } else{ |
|
3651 | 3649 | ?>'<?php echo addslashes( $args['title'] ); ?>'<?php |
3652 | 3650 | |
3653 | 3651 | } |
@@ -3655,7 +3653,7 @@ discard block |
||
3655 | 3653 | ?>, |
3656 | 3654 | help: <?php if ( isset( $args['desc'] ) ) { |
3657 | 3655 | echo "el('span',{dangerouslySetInnerHTML: {__html: '".wp_kses_post( addslashes($args['desc']) )."'}})"; |
3658 | - }else{ echo "''"; } ?>, |
|
3656 | + } else{ echo "''"; } ?>, |
|
3659 | 3657 | value: <?php echo $value; ?>, |
3660 | 3658 | <?php if ( $type == 'TextControl' && $args['type'] != 'text' ) { |
3661 | 3659 | echo "type: '" . addslashes( $args['type'] ) . "',"; |
@@ -3695,7 +3693,7 @@ discard block |
||
3695 | 3693 | foreach ( $custom_attributes as $key => $val ) { |
3696 | 3694 | if(is_array($val)){ |
3697 | 3695 | $attributes .= $key.': {'.$this->array_to_attributes( $val, $html ).'},'; |
3698 | - }else{ |
|
3696 | + } else{ |
|
3699 | 3697 | $attributes .= $html ? " $key='$val' " : "'$key': '$val',"; |
3700 | 3698 | } |
3701 | 3699 | } |
@@ -3735,7 +3733,7 @@ discard block |
||
3735 | 3733 | |
3736 | 3734 | if($new_args['element']=='InnerBlocks'){ |
3737 | 3735 | echo "\n el( InnerBlocks, {"; |
3738 | - }elseif($new_args['element']=='innerBlocksProps'){ |
|
3736 | + } elseif($new_args['element']=='innerBlocksProps'){ |
|
3739 | 3737 | $element = isset($new_args['inner_element']) ? esc_attr($new_args['inner_element']) : 'div'; |
3740 | 3738 | // echo "\n el( 'section', wp.blockEditor.useInnerBlocksProps( blockProps, {"; |
3741 | 3739 | // echo $save ? "\n el( '$element', wp.blockEditor.useInnerBlocksProps.save( " : "\n el( '$element', wp.blockEditor.useInnerBlocksProps( "; |
@@ -3748,11 +3746,11 @@ discard block |
||
3748 | 3746 | // echo '###'; |
3749 | 3747 | |
3750 | 3748 | // echo '###'; |
3751 | - }elseif($new_args['element']=='BlocksProps'){ |
|
3749 | + } elseif($new_args['element']=='BlocksProps'){ |
|
3752 | 3750 | |
3753 | 3751 | if ( isset($new_args['if_inner_element']) ) { |
3754 | 3752 | $element = $new_args['if_inner_element']; |
3755 | - }else { |
|
3753 | + } else { |
|
3756 | 3754 | $element = isset($new_args['inner_element']) ? "'".esc_attr($new_args['inner_element'])."'" : "'div'"; |
3757 | 3755 | } |
3758 | 3756 | |
@@ -3763,7 +3761,7 @@ discard block |
||
3763 | 3761 | |
3764 | 3762 | // echo "} ),"; |
3765 | 3763 | |
3766 | - }else{ |
|
3764 | + } else{ |
|
3767 | 3765 | echo "\n el( '" . $new_args['element'] . "', {"; |
3768 | 3766 | } |
3769 | 3767 | |
@@ -3788,7 +3786,7 @@ discard block |
||
3788 | 3786 | |
3789 | 3787 | if ( $new_key === 'content' ) { |
3790 | 3788 | echo "'" . $this->block_props_replace( wp_slash( $new_value ) ) . "'"; |
3791 | - }else if ( $new_key === 'if_content' ) { |
|
3789 | + } else if ( $new_key === 'if_content' ) { |
|
3792 | 3790 | echo $this->block_props_replace( $new_value ); |
3793 | 3791 | } |
3794 | 3792 | |
@@ -3818,7 +3816,7 @@ discard block |
||
3818 | 3816 | |
3819 | 3817 | if($new_args['element']=='innerBlocksProps' || $new_args['element']=='xBlocksProps'){ |
3820 | 3818 | echo "))";// end content |
3821 | - }else{ |
|
3819 | + } else{ |
|
3822 | 3820 | echo ")";// end content |
3823 | 3821 | } |
3824 | 3822 | |
@@ -4104,7 +4102,7 @@ discard block |
||
4104 | 4102 | |
4105 | 4103 | if(empty($instance['widget_title_tag'])){ |
4106 | 4104 | $output = $args['before_title'] . $title . $args['after_title']; |
4107 | - }else{ |
|
4105 | + } else{ |
|
4108 | 4106 | $title_tag = esc_attr( $instance['widget_title_tag'] ); |
4109 | 4107 | |
4110 | 4108 | // classes |
@@ -4209,9 +4207,9 @@ discard block |
||
4209 | 4207 | <div class='row <?php if(!empty($args['row']['class'])){ echo esc_attr($args['row']['class']);} ?>'> |
4210 | 4208 | <div class='col pr-2'> |
4211 | 4209 | <?php |
4212 | - }elseif(!empty($args['row']['close'])){ |
|
4210 | + } elseif(!empty($args['row']['close'])){ |
|
4213 | 4211 | echo "<div class='col pl-0 ps-0'>"; |
4214 | - }else{ |
|
4212 | + } else{ |
|
4215 | 4213 | echo "<div class='col pl-0 ps-0 pr-2 pe-2'>"; |
4216 | 4214 | } |
4217 | 4215 | } |
@@ -4429,11 +4427,11 @@ discard block |
||
4429 | 4427 | public function get_widget_icon($icon = 'box-top', $title = ''){ |
4430 | 4428 | if($icon=='box-top'){ |
4431 | 4429 | 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>'; |
4432 | - }elseif($icon=='box-right'){ |
|
4430 | + } elseif($icon=='box-right'){ |
|
4433 | 4431 | 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>'; |
4434 | - }elseif($icon=='box-bottom'){ |
|
4432 | + } elseif($icon=='box-bottom'){ |
|
4435 | 4433 | 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>'; |
4436 | - }elseif($icon=='box-left'){ |
|
4434 | + } elseif($icon=='box-left'){ |
|
4437 | 4435 | 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>'; |
4438 | 4436 | } |
4439 | 4437 | } |