Passed
Push — master ( 32890d...b6d11a )
by Brian
13:10
created
vendor/ayecode/wp-super-duper/wp-super-duper.php 1 patch
Braces   +19 added lines, -20 removed lines patch added patch discarded remove patch
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 				<?php
662 662
 				if(! empty( $insert_shortcode_function )){
663 663
 					echo $insert_shortcode_function;
664
-				}else{
664
+				} else{
665 665
 
666 666
 				/**
667 667
 				 * Function for super duper insert shortcode.
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
 					var prev_attributes = [];
1654 1654
 
1655 1655
 					var term_query_type = '';
1656
-					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 "[]";} ?>;
1656
+					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 "[]";} ?>;
1657 1657
 					const taxonomies_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}];
1658 1658
 					const sort_by_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}];
1659 1659
 
@@ -1790,7 +1790,7 @@  discard block
 block discarded – undo
1790 1790
 
1791 1791
 								// taxonomies
1792 1792
 								if( $value && 'post_type' in prev_attributes[props.id] && 'category' in prev_attributes[props.id] && run ){
1793
-									wp.apiFetch({path: "<?php if(isset($this->arguments['post_type']['onchange_rest']['path'])){echo $this->arguments['post_type']['onchange_rest']['path'];}else{'/wp/v2/"+$value+"/categories/?per_page=100';} ?>"}).then(terms => {
1793
+									wp.apiFetch({path: "<?php if(isset($this->arguments['post_type']['onchange_rest']['path'])){echo $this->arguments['post_type']['onchange_rest']['path'];} else{'/wp/v2/"+$value+"/categories/?per_page=100';} ?>"}).then(terms => {
1794 1794
 										while (taxonomies_<?php echo str_replace("-","_", $this->id);?>.length) {
1795 1795
 										taxonomies_<?php echo str_replace("-","_", $this->id);?>.pop();
1796 1796
 									}
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
 										'attributes': props.attributes,
1861 1861
 										'post_id': <?php global $post; if ( isset( $post->ID ) ) {
1862 1862
 										echo $post->ID;
1863
-									}else{echo '0';}?>,
1863
+									} else{echo '0';}?>,
1864 1864
 										'_ajax_nonce': '<?php echo wp_create_nonce( 'super_duper_output_shortcode' );?>'
1865 1865
 									};
1866 1866
 
@@ -1969,7 +1969,7 @@  discard block
 block discarded – undo
1969 1969
 									$panel_count ++;
1970 1970
 
1971 1971
 									}
1972
-									}else {
1972
+									} else {
1973 1973
 									?>
1974 1974
 									el(wp.components.PanelBody, {
1975 1975
 											title: '<?php esc_attr_e( "Settings" ); ?>',
@@ -1995,7 +1995,7 @@  discard block
 block discarded – undo
1995 1995
 								// If the user sets block-output array then build it
1996 1996
 								if ( ! empty( $this->options['block-output'] ) ) {
1997 1997
 								$this->block_element( $this->options['block-output'] );
1998
-							}else{
1998
+							} else{
1999 1999
 								// if no block-output is set then we try and get the shortcode html output via ajax.
2000 2000
 								?>
2001 2001
 								el('div', {
@@ -2065,7 +2065,7 @@  discard block
 block discarded – undo
2065 2065
 							?>
2066 2066
 							return content;
2067 2067
 							<?php
2068
-							}else{
2068
+							} else{
2069 2069
 							?>
2070 2070
 							var block_wrap = 'div';
2071 2071
 							if (attr.hasOwnProperty("block_wrap")) {
@@ -2136,7 +2136,7 @@  discard block
 block discarded – undo
2136 2136
 
2137 2137
 					<?php
2138 2138
 					if(false){?></script><?php }
2139
-				}elseif(!empty($args['row']['close'])){
2139
+				} elseif(!empty($args['row']['close'])){
2140 2140
 					if(false){?><script><?php }?>
2141 2141
 						el(
2142 2142
 							'div',
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
 							},
2146 2146
 					<?php
2147 2147
 					if(false){?></script><?php }
2148
-				}else{
2148
+				} else{
2149 2149
 					if(false){?><script><?php }?>
2150 2150
 						el(
2151 2151
 							'div',
@@ -2262,8 +2262,7 @@  discard block
 block discarded – undo
2262 2262
                             $key: value
2263 2263
                         });
2264 2264
                     },";
2265
-			}
2266
-			elseif ( $args['type'] == 'checkbox' ) {
2265
+			} elseif ( $args['type'] == 'checkbox' ) {
2267 2266
 				$type = 'CheckboxControl';
2268 2267
 				$extra .= "checked: props.attributes.$key,";
2269 2268
 				$onchange = "props.setAttributes({ $key: ! props.attributes.$key } )";
@@ -2274,9 +2273,9 @@  discard block
 block discarded – undo
2274 2273
 
2275 2274
 				if($args['name'] == 'category' && !empty($args['post_type_linked'])){
2276 2275
 					$options .= "options: taxonomies_".str_replace("-","_", $this->id).",";
2277
-				}elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){
2276
+				} elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){
2278 2277
 					$options .= "options: sort_by_".str_replace("-","_", $this->id).",";
2279
-				}else {
2278
+				} else {
2280 2279
 
2281 2280
 					if ( ! empty( $args['options'] ) ) {
2282 2281
 						$options .= "options: [";
@@ -2291,7 +2290,7 @@  discard block
 block discarded – undo
2291 2290
 				}
2292 2291
 			} elseif ( $args['type'] == 'alignment' ) {
2293 2292
 				$type = 'AlignmentToolbar'; // @todo this does not seem to work but cant find a example
2294
-			}elseif ( $args['type'] == 'margins' ) {
2293
+			} elseif ( $args['type'] == 'margins' ) {
2295 2294
 
2296 2295
 			} else {
2297 2296
 				return;// if we have not implemented the control then don't break the JS.
@@ -2711,7 +2710,7 @@  discard block
 block discarded – undo
2711 2710
 
2712 2711
 				if(empty($instance['widget_title_tag'])){
2713 2712
 					$output = $args['before_title'] . $title . $args['after_title'];
2714
-				}else{
2713
+				} else{
2715 2714
 					$title_tag = esc_attr( $instance['widget_title_tag'] );
2716 2715
 
2717 2716
 					// classes
@@ -2816,9 +2815,9 @@  discard block
 block discarded – undo
2816 2815
 					<div class='row <?php if(!empty($args['row']['class'])){ echo esc_attr($args['row']['class']);} ?>'>
2817 2816
 					<div class='col pr-2'>
2818 2817
 					<?php
2819
-				}elseif(!empty($args['row']['close'])){
2818
+				} elseif(!empty($args['row']['close'])){
2820 2819
 					echo "<div class='col pl-0'>";
2821
-				}else{
2820
+				} else{
2822 2821
 					echo "<div class='col pl-0 pr-2'>";
2823 2822
 				}
2824 2823
 			}
@@ -3036,11 +3035,11 @@  discard block
 block discarded – undo
3036 3035
 		public function get_widget_icon($icon = 'box-top', $title = ''){
3037 3036
 			if($icon=='box-top'){
3038 3037
 				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>';
3039
-			}elseif($icon=='box-right'){
3038
+			} elseif($icon=='box-right'){
3040 3039
 				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>';
3041
-			}elseif($icon=='box-bottom'){
3040
+			} elseif($icon=='box-bottom'){
3042 3041
 				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>';
3043
-			}elseif($icon=='box-left'){
3042
+			} elseif($icon=='box-left'){
3044 3043
 				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>';
3045 3044
 			}
3046 3045
 		}
Please login to merge, or discard this patch.