@@ -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. |
@@ -2231,7 +2231,7 @@ discard block |
||
2231 | 2231 | $p_pl = 'ps-'; |
2232 | 2232 | $p_pr = 'pe-'; |
2233 | 2233 | <?php |
2234 | - }else{ |
|
2234 | + } else{ |
|
2235 | 2235 | ?> |
2236 | 2236 | $aui_bs5 = false; |
2237 | 2237 | $p_ml = 'ml-'; |
@@ -2459,7 +2459,7 @@ discard block |
||
2459 | 2459 | var InnerBlocks = blockEditor.InnerBlocks; |
2460 | 2460 | |
2461 | 2461 | var term_query_type = ''; |
2462 | - 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 "[]";} ?>; |
|
2462 | + 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 "[]";} ?>; |
|
2463 | 2463 | const taxonomies_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
2464 | 2464 | const sort_by_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
2465 | 2465 | const MediaUpload = wp.blockEditor.MediaUpload; |
@@ -2516,9 +2516,9 @@ discard block |
||
2516 | 2516 | $example_inner_blocks = !empty($this->options['example']['innerBlocks']) && is_array($this->options['example']['innerBlocks']) ? 'innerBlocks: ' . wp_json_encode($this->options['example']['innerBlocks']) : ''; |
2517 | 2517 | if( isset( $this->options['example'] ) && $this->options['example'] === false ){ |
2518 | 2518 | // no preview if set to false |
2519 | - }elseif( !empty( $example_args ) ){ |
|
2519 | + } elseif( !empty( $example_args ) ){ |
|
2520 | 2520 | echo "example : {attributes:{".$this->array_to_attributes( $example_args )."},$viewport_width},"; |
2521 | - }elseif( !empty( $this->options['example'] ) ){ |
|
2521 | + } elseif( !empty( $this->options['example'] ) ){ |
|
2522 | 2522 | unset($this->options['example']['viewportWidth']); |
2523 | 2523 | unset($this->options['example']['innerBlocks']); |
2524 | 2524 | $example_atts = $this->array_to_attributes( $this->options['example'] ); |
@@ -2535,7 +2535,7 @@ discard block |
||
2535 | 2535 | if(!empty($example_parts)){ |
2536 | 2536 | echo "example : {".implode(',', $example_parts)."},"; |
2537 | 2537 | } |
2538 | - }else{ |
|
2538 | + } else{ |
|
2539 | 2539 | echo 'example : {viewportWidth: 500},'; |
2540 | 2540 | } |
2541 | 2541 | |
@@ -2605,8 +2605,7 @@ discard block |
||
2605 | 2605 | |
2606 | 2606 | if ( $args['type'] == 'notice' || $args['type'] == 'tab' ) { |
2607 | 2607 | continue; |
2608 | - } |
|
2609 | - elseif ( $args['type'] == 'checkbox' ) { |
|
2608 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
2610 | 2609 | $type = 'boolean'; |
2611 | 2610 | $default = isset( $args['default'] ) && $args['default'] ? 'true' : 'false'; |
2612 | 2611 | } elseif ( $args['type'] == 'number' ) { |
@@ -2740,7 +2739,7 @@ discard block |
||
2740 | 2739 | <?php |
2741 | 2740 | if(!empty($this->options['block-edit-raw'])) { |
2742 | 2741 | echo $this->options['block-edit-raw']; // strings have to be in single quotes, may cause issues |
2743 | - }else{ |
|
2742 | + } else{ |
|
2744 | 2743 | ?> |
2745 | 2744 | |
2746 | 2745 | function hasSelectedInnerBlock(props) { |
@@ -2875,7 +2874,7 @@ discard block |
||
2875 | 2874 | $current_screen = function_exists('get_current_screen') ? get_current_screen() : ''; |
2876 | 2875 | if(!empty($current_screen->base) && $current_screen->base==='widgets'){ |
2877 | 2876 | echo 'const { deviceType } = "";'; |
2878 | -}else{ |
|
2877 | +} else{ |
|
2879 | 2878 | ?> |
2880 | 2879 | /** Get device type const. */ |
2881 | 2880 | const { deviceType } = wp.data.useSelect != 'undefined' ? wp.data.useSelect(select => { |
@@ -2910,7 +2909,7 @@ discard block |
||
2910 | 2909 | 'block_parent_name': parentBlocks.length ? parentBlocks[parentBlocks.length - 1].name : '', |
2911 | 2910 | 'post_id': <?php global $post; if ( isset( $post->ID ) ) { |
2912 | 2911 | echo $post->ID; |
2913 | - }else{echo '0';}?>, |
|
2912 | + } else{echo '0';}?>, |
|
2914 | 2913 | '_ajax_nonce': '<?php echo wp_create_nonce( 'super_duper_output_shortcode' );?>' |
2915 | 2914 | }; |
2916 | 2915 | |
@@ -2930,7 +2929,7 @@ discard block |
||
2930 | 2929 | is_fetching = false; |
2931 | 2930 | prev_attributes[props.clientId] = props.attributes; |
2932 | 2931 | <?php |
2933 | - }else{ |
|
2932 | + } else{ |
|
2934 | 2933 | ?> |
2935 | 2934 | props.setAttributes({content: env}); |
2936 | 2935 | is_fetching = false; |
@@ -3137,7 +3136,7 @@ discard block |
||
3137 | 3136 | // |
3138 | 3137 | |
3139 | 3138 | } |
3140 | - }else { |
|
3139 | + } else { |
|
3141 | 3140 | ?> |
3142 | 3141 | el(wp.components.PanelBody, { |
3143 | 3142 | title: '<?php esc_attr_e( "Settings", 'ayecode-connect' ); ?>', |
@@ -3163,9 +3162,9 @@ discard block |
||
3163 | 3162 | // If the user sets block-output array then build it |
3164 | 3163 | if ( ! empty( $this->options['block-output'] ) ) { |
3165 | 3164 | $this->block_element( $this->options['block-output'] ); |
3166 | - }elseif(!empty($this->options['block-edit-return'])){ |
|
3165 | + } elseif(!empty($this->options['block-edit-return'])){ |
|
3167 | 3166 | echo $this->options['block-edit-return']; |
3168 | - }else{ |
|
3167 | + } else{ |
|
3169 | 3168 | // if no block-output is set then we try and get the shortcode html output via ajax. |
3170 | 3169 | $block_edit_wrap_tag = !empty($this->options['block_edit_wrap_tag']) ? esc_attr($this->options['block_edit_wrap_tag']) : 'div'; |
3171 | 3170 | ?> |
@@ -3277,9 +3276,9 @@ discard block |
||
3277 | 3276 | ); |
3278 | 3277 | <?php |
3279 | 3278 | |
3280 | - }elseif(!empty($this->options['block-save-return'])){ |
|
3279 | + } elseif(!empty($this->options['block-save-return'])){ |
|
3281 | 3280 | echo 'return ' . $this->options['block-save-return']; |
3282 | - }elseif(!empty($this->options['nested-block'])){ |
|
3281 | + } elseif(!empty($this->options['nested-block'])){ |
|
3283 | 3282 | ?> |
3284 | 3283 | return el( |
3285 | 3284 | '', |
@@ -3289,13 +3288,13 @@ discard block |
||
3289 | 3288 | // el('', {dangerouslySetInnerHTML: {__html: "[/<?php echo $this->options['base_id'];?>]"}}) |
3290 | 3289 | ); |
3291 | 3290 | <?php |
3292 | - }elseif(!empty( $this->options['block-save-return'] ) ){ |
|
3291 | + } elseif(!empty( $this->options['block-save-return'] ) ){ |
|
3293 | 3292 | echo "return ". $this->options['block-edit-return'].";"; |
3294 | - }elseif(isset( $this->options['block-wrap'] ) && $this->options['block-wrap'] == ''){ |
|
3293 | + } elseif(isset( $this->options['block-wrap'] ) && $this->options['block-wrap'] == ''){ |
|
3295 | 3294 | ?> |
3296 | 3295 | return content; |
3297 | 3296 | <?php |
3298 | - }else{ |
|
3297 | + } else{ |
|
3299 | 3298 | ?> |
3300 | 3299 | var block_wrap = 'div'; |
3301 | 3300 | if (attr.hasOwnProperty("block_wrap")) { |
@@ -3346,9 +3345,9 @@ discard block |
||
3346 | 3345 | $device_type_icon = ''; |
3347 | 3346 | if($device_type=='Desktop'){ |
3348 | 3347 | $device_type_icon = '<span class="dashicons dashicons-desktop" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3349 | - }elseif($device_type=='Tablet'){ |
|
3348 | + } elseif($device_type=='Tablet'){ |
|
3350 | 3349 | $device_type_icon = '<span class="dashicons dashicons-tablet" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3351 | - }elseif($device_type=='Mobile'){ |
|
3350 | + } elseif($device_type=='Mobile'){ |
|
3352 | 3351 | $device_type_icon = '<span class="dashicons dashicons-smartphone" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3353 | 3352 | } |
3354 | 3353 | echo $element_require; |
@@ -3393,7 +3392,7 @@ discard block |
||
3393 | 3392 | |
3394 | 3393 | <?php |
3395 | 3394 | if(false){?></script><?php } |
3396 | - }elseif(!empty($args['row']['close'])){ |
|
3395 | + } elseif(!empty($args['row']['close'])){ |
|
3397 | 3396 | if(false){?><script><?php }?> |
3398 | 3397 | el( |
3399 | 3398 | 'div', |
@@ -3402,7 +3401,7 @@ discard block |
||
3402 | 3401 | }, |
3403 | 3402 | <?php |
3404 | 3403 | if(false){?></script><?php } |
3405 | - }else{ |
|
3404 | + } else{ |
|
3406 | 3405 | if(false){?><script><?php }?> |
3407 | 3406 | el( |
3408 | 3407 | 'div', |
@@ -3507,9 +3506,9 @@ discard block |
||
3507 | 3506 | $device_type_icon = ''; |
3508 | 3507 | if($device_type=='Desktop'){ |
3509 | 3508 | $device_type_icon = '<span class="dashicons dashicons-desktop" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3510 | - }elseif($device_type=='Tablet'){ |
|
3509 | + } elseif($device_type=='Tablet'){ |
|
3511 | 3510 | $device_type_icon = '<span class="dashicons dashicons-tablet" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3512 | - }elseif($device_type=='Mobile'){ |
|
3511 | + } elseif($device_type=='Mobile'){ |
|
3513 | 3512 | $device_type_icon = '<span class="dashicons dashicons-smartphone" style="font-size: 18px;" onclick="sd_show_view_options(this);"></span>'; |
3514 | 3513 | } |
3515 | 3514 | |
@@ -3572,7 +3571,7 @@ discard block |
||
3572 | 3571 | $args['type'] == 'text'; |
3573 | 3572 | // Save numbers as numbers and not strings |
3574 | 3573 | $value = "props.attributes.$key ? props.attributes.$key : ''"; |
3575 | - }else if ( $args['type'] == 'notice' ) { |
|
3574 | + } else if ( $args['type'] == 'notice' ) { |
|
3576 | 3575 | |
3577 | 3576 | $notice_message = !empty($args['desc']) ? addslashes($args['desc']) : ''; |
3578 | 3577 | $notice_status = !empty($args['status']) ? esc_attr($args['status']) : 'info'; |
@@ -3647,7 +3646,7 @@ discard block |
||
3647 | 3646 | $key: value |
3648 | 3647 | }); |
3649 | 3648 | },"; |
3650 | - }elseif ( $args['type'] == 'gradient' ) { |
|
3649 | + } elseif ( $args['type'] == 'gradient' ) { |
|
3651 | 3650 | $type = 'GradientPicker'; |
3652 | 3651 | $extra .= "gradients: [{ |
3653 | 3652 | name: 'Vivid cyan blue to vivid purple', |
@@ -3686,7 +3685,7 @@ discard block |
||
3686 | 3685 | slug: 'cool-to-warm-spectrum', |
3687 | 3686 | }],"; |
3688 | 3687 | |
3689 | - }elseif ( $args['type'] == 'image' ) { |
|
3688 | + } elseif ( $args['type'] == 'image' ) { |
|
3690 | 3689 | // print_r($args); |
3691 | 3690 | |
3692 | 3691 | $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,{ |
@@ -3823,8 +3822,7 @@ discard block |
||
3823 | 3822 | $onchange = ""; |
3824 | 3823 | |
3825 | 3824 | //$inside_elements = ",el('div',{},'file upload')"; |
3826 | - } |
|
3827 | - elseif ( $args['type'] == 'checkbox' ) { |
|
3825 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
3828 | 3826 | $type = 'CheckboxControl'; |
3829 | 3827 | $extra .= "checked: props.attributes.$key,"; |
3830 | 3828 | $onchange = "props.setAttributes({ $key: ! props.attributes.$key } )"; |
@@ -3836,9 +3834,9 @@ discard block |
||
3836 | 3834 | |
3837 | 3835 | if($args['name'] == 'category' && !empty($args['post_type_linked'])){ |
3838 | 3836 | $options .= "options: taxonomies_".str_replace("-","_", $this->id).","; |
3839 | - }elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
3837 | + } elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
3840 | 3838 | $options .= "options: sort_by_".str_replace("-","_", $this->id).","; |
3841 | - }else { |
|
3839 | + } else { |
|
3842 | 3840 | |
3843 | 3841 | if ( ! empty( $args['options'] ) ) { |
3844 | 3842 | $options .= "options: ["; |
@@ -4002,7 +4000,7 @@ discard block |
||
4002 | 4000 | foreach ( $custom_attributes as $key => $val ) { |
4003 | 4001 | if(is_array($val)){ |
4004 | 4002 | $attributes .= $key.': {'.$this->array_to_attributes( $val, $html ).'},'; |
4005 | - }else{ |
|
4003 | + } else{ |
|
4006 | 4004 | $attributes .= $html ? " $key='$val' " : "'$key': '$val',"; |
4007 | 4005 | } |
4008 | 4006 | } |
@@ -4043,7 +4041,7 @@ discard block |
||
4043 | 4041 | |
4044 | 4042 | if($new_args['element']=='InnerBlocks'){ |
4045 | 4043 | echo "\n el( InnerBlocks, {"; |
4046 | - }elseif($new_args['element']=='innerBlocksProps'){ |
|
4044 | + } elseif($new_args['element']=='innerBlocksProps'){ |
|
4047 | 4045 | $element = isset($new_args['inner_element']) ? esc_attr($new_args['inner_element']) : 'div'; |
4048 | 4046 | // echo "\n el( 'section', wp.blockEditor.useInnerBlocksProps( blockProps, {"; |
4049 | 4047 | // echo $save ? "\n el( '$element', wp.blockEditor.useInnerBlocksProps.save( " : "\n el( '$element', wp.blockEditor.useInnerBlocksProps( "; |
@@ -4056,11 +4054,11 @@ discard block |
||
4056 | 4054 | // echo '###'; |
4057 | 4055 | |
4058 | 4056 | // echo '###'; |
4059 | - }elseif($new_args['element']=='BlocksProps'){ |
|
4057 | + } elseif($new_args['element']=='BlocksProps'){ |
|
4060 | 4058 | |
4061 | 4059 | if ( isset($new_args['if_inner_element']) ) { |
4062 | 4060 | $element = $new_args['if_inner_element']; |
4063 | - }else { |
|
4061 | + } else { |
|
4064 | 4062 | $element = isset($new_args['inner_element']) ? "'".esc_attr($new_args['inner_element'])."'" : "'div'"; |
4065 | 4063 | } |
4066 | 4064 | |
@@ -4071,7 +4069,7 @@ discard block |
||
4071 | 4069 | |
4072 | 4070 | // echo "} ),"; |
4073 | 4071 | |
4074 | - }else{ |
|
4072 | + } else{ |
|
4075 | 4073 | echo "\n el( '" . $new_args['element'] . "', {"; |
4076 | 4074 | } |
4077 | 4075 | |
@@ -4096,7 +4094,7 @@ discard block |
||
4096 | 4094 | |
4097 | 4095 | if ( $new_key === 'content' ) { |
4098 | 4096 | echo "'" . $this->block_props_replace( wp_slash( $new_value ) ) . "'"; |
4099 | - }else if ( $new_key === 'if_content' ) { |
|
4097 | + } else if ( $new_key === 'if_content' ) { |
|
4100 | 4098 | echo $this->block_props_replace( $new_value ); |
4101 | 4099 | } |
4102 | 4100 | |
@@ -4126,7 +4124,7 @@ discard block |
||
4126 | 4124 | |
4127 | 4125 | if($new_args['element']=='innerBlocksProps' || $new_args['element']=='xBlocksProps'){ |
4128 | 4126 | echo "))";// end content |
4129 | - }else{ |
|
4127 | + } else{ |
|
4130 | 4128 | echo ")";// end content |
4131 | 4129 | } |
4132 | 4130 | |
@@ -4750,11 +4748,11 @@ discard block |
||
4750 | 4748 | public function get_widget_icon($icon = 'box-top', $title = ''){ |
4751 | 4749 | if($icon=='box-top'){ |
4752 | 4750 | 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>'; |
4753 | - }elseif($icon=='box-right'){ |
|
4751 | + } elseif($icon=='box-right'){ |
|
4754 | 4752 | 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>'; |
4755 | - }elseif($icon=='box-bottom'){ |
|
4753 | + } elseif($icon=='box-bottom'){ |
|
4756 | 4754 | 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>'; |
4757 | - }elseif($icon=='box-left'){ |
|
4755 | + } elseif($icon=='box-left'){ |
|
4758 | 4756 | 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>'; |
4759 | 4757 | } |
4760 | 4758 | } |
@@ -3720,7 +3720,7 @@ |
||
3720 | 3720 | if(! empty($parsed_block['attrs']['sd_shortcode_close'])){ |
3721 | 3721 | $content = isset($parsed_block['attrs']['html']) ? $parsed_block['attrs']['html'] : $block_content; |
3722 | 3722 | $block_content = $parsed_block['attrs']['sd_shortcode'].$content.$parsed_block['attrs']['sd_shortcode_close']; |
3723 | - }elseif(! empty($parsed_block['attrs']['sd_shortcode'])){ |
|
3723 | + } elseif(! empty($parsed_block['attrs']['sd_shortcode'])){ |
|
3724 | 3724 | $has_warp = false; |
3725 | 3725 | if($block_content && strpos(trim($block_content), '<div class="wp-block-') === 0 ){ |
3726 | 3726 | $parts = explode('></', $block_content); |