Completed
Pull Request — develop (#1588)
by
unknown
37:25 queued 17:24
created
future/includes/gutenberg/class-gv-gutenberg-blocks.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 				$block_class = array_values( array_diff( get_declared_classes(), $declared_classes ) );
51 51
 
52 52
 				if ( ! empty( $block_class ) ) {
53
-					$block_class = new $block_class[0]();
53
+					$block_class = new $block_class[ 0 ]();
54 54
 
55 55
 					if ( is_callable( [ $block_class, 'modify_block_meta' ] ) ) {
56 56
 						$block_meta = array_merge( $block_meta, $block_class->modify_block_meta( $block_meta ) );
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 				$localization_data = Arr::get( $block_meta, 'localization' );
62 62
 
63 63
 				if ( $localization_data ) {
64
-					add_filter( 'gk/gravityview/gutenberg/blocks/localization', function ( $localization ) use ( $block_name, $localization_data ) {
64
+					add_filter( 'gk/gravityview/gutenberg/blocks/localization', function( $localization ) use ( $block_name, $localization_data ) {
65 65
 						$localization[ $block_name ] = $localization_data;
66 66
 
67 67
 						return $localization;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			'views'               => $this->get_views()
118 118
 		] );
119 119
 
120
-		wp_register_script( self::SLUG, false, [] );
120
+		wp_register_script( self::SLUG, false, [ ] );
121 121
 
122 122
 		wp_enqueue_script( self::SLUG );
123 123
 
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 			'order'   => 'ASC',
142 142
 		] );
143 143
 
144
-		$formatted_views = array_map( function ( $view ) {
144
+		$formatted_views = array_map( function( $view ) {
145 145
 			return [
146
-				'value' => (string) $view->ID,
146
+				'value' => (string)$view->ID,
147 147
 				'label' => sprintf(
148 148
 					'%s (#%s)',
149 149
 					$view->post_title ?: esc_html__( 'View', 'gk-gravityview' ),
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
 		$newly_registered_styles  = array_diff( $styles_after_shortcode, $styles_before_shortcode );
195 195
 
196 196
 		// This will return an array of all dependencies sorted in the order they should be loaded.
197
-		$get_dependencies = function ( $handle, $source, $dependencies = [] ) use ( &$get_dependencies ) {
197
+		$get_dependencies = function( $handle, $source, $dependencies = [ ] ) use ( &$get_dependencies ) {
198 198
 			if ( empty( $source->registered[ $handle ] ) ) {
199 199
 				return $dependencies;
200 200
 			}
201 201
 
202
-			if ( $source->registered[ $handle ]->extra && ! empty( $source->registered[ $handle ]->extra['data'] ) ) {
203
-				array_unshift( $dependencies, array_filter( [ 'src' => $source->registered[ $handle ]->src, 'data' => $source->registered[ $handle ]->extra['data'] ] ) );
202
+			if ( $source->registered[ $handle ]->extra && ! empty( $source->registered[ $handle ]->extra[ 'data' ] ) ) {
203
+				array_unshift( $dependencies, array_filter( [ 'src' => $source->registered[ $handle ]->src, 'data' => $source->registered[ $handle ]->extra[ 'data' ] ] ) );
204 204
 			} else if ( $source->registered[ $handle ]->src ) {
205 205
 				array_unshift( $dependencies, $source->registered[ $handle ]->src );
206 206
 			}
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 			return array_flatten( $dependencies );
217 217
 		};
218 218
 
219
-		$script_dependencies = [];
219
+		$script_dependencies = [ ];
220 220
 		foreach ( $newly_registered_scripts as $script ) {
221 221
 			$script_dependencies = array_merge( $script_dependencies, $get_dependencies( $script, $wp_scripts ) );
222 222
 		}
223 223
 
224
-		$style_dependencies = [];
224
+		$style_dependencies = [ ];
225 225
 		foreach ( $newly_registered_styles as $style ) {
226 226
 			$style_dependencies = array_merge( $style_dependencies, $get_dependencies( $style, $wp_styles ) );
227 227
 		}
Please login to merge, or discard this patch.
future/includes/gutenberg/blocks/entry-field/block.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @return string $output
38 38
 	 */
39
-	static function render( $block_attributes = [] ) {
39
+	static function render( $block_attributes = [ ] ) {
40 40
 		$block_to_shortcode_attributes_map = [
41 41
 			'viewId'                => 'view_id',
42 42
 			'entryId'               => 'entry_id',
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
 			'fieldSettingOverrides' => 'field_setting_overrides',
45 45
 		];
46 46
 
47
-		$shortcode_attributes = [];
47
+		$shortcode_attributes = [ ];
48 48
 
49 49
 		foreach ( $block_attributes as $attribute => $value ) {
50 50
 			$value = esc_attr( sanitize_text_field( $value ) );
51 51
 
52 52
 			if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) {
53 53
 				if ( 'field_setting_overrides' === $attribute ) {
54
-					$shortcode_attributes[] = $value;
54
+					$shortcode_attributes[ ] = $value;
55 55
 				} else {
56
-					$shortcode_attributes[] = sprintf(
56
+					$shortcode_attributes[ ] = sprintf(
57 57
 						'%s="%s"',
58 58
 						$block_to_shortcode_attributes_map[ $attribute ],
59 59
 						str_replace( '"', '\"', $value )
@@ -70,6 +70,6 @@  discard block
 block discarded – undo
70 70
 
71 71
 		$rendered_shortcode = Blocks::render_shortcode( $shortcode );
72 72
 
73
-		return $rendered_shortcode['content'];
73
+		return $rendered_shortcode[ 'content' ];
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
future/includes/gutenberg/blocks/entry/block.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @return string $output
38 38
 	 */
39
-	static function render( $block_attributes = [] ) {
39
+	static function render( $block_attributes = [ ] ) {
40 40
 		$block_to_shortcode_attributes_map = [
41 41
 			'entryId' => 'id',
42 42
 			'viewId'  => 'view_id',
43 43
 		];
44 44
 
45
-		$shortcode_attributes = [];
45
+		$shortcode_attributes = [ ];
46 46
 
47 47
 		foreach ( $block_attributes as $attribute => $value ) {
48 48
 			$value = esc_attr( sanitize_text_field( $value ) );
49 49
 
50 50
 			if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) {
51
-				$shortcode_attributes[] = sprintf(
51
+				$shortcode_attributes[ ] = sprintf(
52 52
 					'%s="%s"',
53 53
 					$block_to_shortcode_attributes_map[ $attribute ],
54 54
 					str_replace( '"', '\"', $value )
@@ -64,6 +64,6 @@  discard block
 block discarded – undo
64 64
 
65 65
 		$rendered_shortcode = Blocks::render_shortcode( $shortcode );
66 66
 
67
-		return $rendered_shortcode['content'];
67
+		return $rendered_shortcode[ 'content' ];
68 68
 	}
69 69
 }
Please login to merge, or discard this patch.
future/includes/gutenberg/blocks/view/block.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return string $output
39 39
 	 */
40
-	static function render( $block_attributes = [] ) {
40
+	static function render( $block_attributes = [ ] ) {
41 41
 		$block_to_shortcode_attributes_map = [
42 42
 			'viewId'         => 'id',
43 43
 			'postId'         => 'post_id',
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 			'backLinkLabel'  => 'back_link_label',
56 56
 		];
57 57
 
58
-		if ( isset( $block_attributes['searchOperator'] ) && empty( $block_attributes['searchValue'] ) ) {
59
-			unset( $block_attributes['searchOperator'] );
58
+		if ( isset( $block_attributes[ 'searchOperator' ] ) && empty( $block_attributes[ 'searchValue' ] ) ) {
59
+			unset( $block_attributes[ 'searchOperator' ] );
60 60
 		}
61 61
 
62
-		$shortcode_attributes = [];
62
+		$shortcode_attributes = [ ];
63 63
 
64 64
 		foreach ( $block_attributes as $attribute => $value ) {
65 65
 			$value = esc_attr( sanitize_text_field( $value ) );
66 66
 
67 67
 			if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) {
68
-				$shortcode_attributes[] = sprintf(
68
+				$shortcode_attributes[ ] = sprintf(
69 69
 					'%s="%s"',
70 70
 					$block_to_shortcode_attributes_map[ $attribute ],
71 71
 					str_replace( '"', '\"', $value )
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		}
95 95
 
96 96
 		if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) {
97
-			return $rendered_shortcode['content'];
97
+			return $rendered_shortcode[ 'content' ];
98 98
 		}
99 99
 
100 100
 		return json_encode( $rendered_shortcode );
Please login to merge, or discard this patch.
future/includes/gutenberg/blocks/view-details/block.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @return string $output
38 38
 	 */
39
-	static function render( $block_attributes = [] ) {
39
+	static function render( $block_attributes = [ ] ) {
40 40
 		$block_to_shortcode_attributes_map = [
41 41
 			'viewId' => 'id',
42 42
 			'detail' => 'detail',
43 43
 		];
44 44
 
45
-		$shortcode_attributes = [];
45
+		$shortcode_attributes = [ ];
46 46
 
47 47
 		foreach ( $block_attributes as $attribute => $value ) {
48 48
 			$value = esc_attr( sanitize_text_field( $value ) );
49 49
 
50 50
 			if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) {
51
-				$shortcode_attributes[] = sprintf(
51
+				$shortcode_attributes[ ] = sprintf(
52 52
 					'%s="%s"',
53 53
 					$block_to_shortcode_attributes_map[ $attribute ],
54 54
 					str_replace( '"', '\"', $value )
@@ -64,6 +64,6 @@  discard block
 block discarded – undo
64 64
 
65 65
 		$rendered_shortcode = Blocks::render_shortcode( $shortcode );
66 66
 
67
-		return $rendered_shortcode['content'];
67
+		return $rendered_shortcode[ 'content' ];
68 68
 	}
69 69
 }
Please login to merge, or discard this patch.
future/includes/gutenberg/blocks/entry-link/block.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @return string $output
38 38
 	 */
39
-	static function render( $block_attributes = [] ) {
39
+	static function render( $block_attributes = [ ] ) {
40 40
 		$block_to_shortcode_attributes_map = [
41 41
 			'viewId'       => 'view_id',
42 42
 			'entryId'      => 'entry_id',
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
 			'content'      => 'content',
49 49
 		];
50 50
 
51
-		$shortcode_attributes = [];
51
+		$shortcode_attributes = [ ];
52 52
 
53 53
 		foreach ( $block_attributes as $attribute => $value ) {
54 54
 			$value = esc_attr( sanitize_text_field( $value ) );
55 55
 
56 56
 			if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) {
57
-				$shortcode_attributes[] = sprintf(
57
+				$shortcode_attributes[ ] = sprintf(
58 58
 					'%s="%s"',
59 59
 					$block_to_shortcode_attributes_map[ $attribute ],
60 60
 					str_replace( '"', '\"', $value )
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 			}
63 63
 		}
64 64
 
65
-		if ( ! empty( $block_attributes['content'] ) ) {
65
+		if ( ! empty( $block_attributes[ 'content' ] ) ) {
66 66
 			$shortcode = sprintf(
67 67
 				'[gv_entry_link %s]%s[/gv_entry_link]',
68 68
 				implode( ' ', $shortcode_attributes ),
69
-				wp_kses_post( $block_attributes['content'] )
69
+				wp_kses_post( $block_attributes[ 'content' ] )
70 70
 			);
71 71
 		} else {
72 72
 			$shortcode = sprintf( '[gv_entry_link %s/]', implode( ' ', $shortcode_attributes ) );
@@ -82,6 +82,6 @@  discard block
 block discarded – undo
82 82
 
83 83
 		$rendered_shortcode = Blocks::render_shortcode( $shortcode );
84 84
 
85
-		return $rendered_shortcode['content'];
85
+		return $rendered_shortcode[ 'content' ];
86 86
 	}
87 87
 }
Please login to merge, or discard this patch.
future/includes/gutenberg/build/entry.asset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'fdc502e45d34500dfc4d');
1
+<?php return array( 'dependencies' => array( 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => 'fdc502e45d34500dfc4d' );
Please login to merge, or discard this patch.
future/includes/gutenberg/build/view.asset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php return array('dependencies' => array('moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '071d742fcde1975a4b50');
1
+<?php return array( 'dependencies' => array( 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => '071d742fcde1975a4b50' );
Please login to merge, or discard this patch.
future/includes/gutenberg/build/entry-field.asset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '9c0af81bd6374d1e7f5d');
1
+<?php return array( 'dependencies' => array( 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => '9c0af81bd6374d1e7f5d' );
Please login to merge, or discard this patch.