@@ -36,19 +36,19 @@ discard block |
||
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( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
51 | + $shortcode_attributes[ ] = sprintf( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -60,6 +60,6 @@ discard block |
||
60 | 60 | |
61 | 61 | $rendered_shortcode = Blocks::render_shortcode( $shortcode ); |
62 | 62 | |
63 | - return $rendered_shortcode['content']; |
|
63 | + return $rendered_shortcode[ 'content' ]; |
|
64 | 64 | } |
65 | 65 | } |
@@ -36,7 +36,7 @@ discard block |
||
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 |
||
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( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
56 | + $shortcode_attributes[ ] = sprintf( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | } |
@@ -66,6 +66,6 @@ discard block |
||
66 | 66 | |
67 | 67 | $rendered_shortcode = Blocks::render_shortcode( $shortcode ); |
68 | 68 | |
69 | - return $rendered_shortcode['content']; |
|
69 | + return $rendered_shortcode[ 'content' ]; |
|
70 | 70 | } |
71 | 71 | } |
@@ -1,1 +1,1 @@ |
||
1 | -<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '6b77cdda5d084b4ef59c'); |
|
1 | +<?php return array( 'dependencies' => array( 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => '6b77cdda5d084b4ef59c' ); |
@@ -1,1 +1,1 @@ |
||
1 | -<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'da6fd4a616824f910f13'); |
|
1 | +<?php return array( 'dependencies' => array( 'lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => 'da6fd4a616824f910f13' ); |
@@ -1,1 +1,1 @@ |
||
1 | -<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '4ac3420333ad6fb63793'); |
|
1 | +<?php return array( 'dependencies' => array( 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => '4ac3420333ad6fb63793' ); |
@@ -1,1 +1,1 @@ |
||
1 | -<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'f60d46c6d1f7683429d7'); |
|
1 | +<?php return array( 'dependencies' => array( 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => 'f60d46c6d1f7683429d7' ); |
@@ -1,1 +1,1 @@ |
||
1 | -<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '6ed51005c4be607b786e'); |
|
1 | +<?php return array( 'dependencies' => array( 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-url' ), 'version' => '6ed51005c4be607b786e' ); |
@@ -50,7 +50,7 @@ discard block |
||
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 |
||
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; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | 'views' => $this->get_views() |
114 | 114 | ] ); |
115 | 115 | |
116 | - wp_register_script( self::SLUG, false, [] ); |
|
116 | + wp_register_script( self::SLUG, false, [ ] ); |
|
117 | 117 | |
118 | 118 | wp_enqueue_script( self::SLUG ); |
119 | 119 | |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | 'order' => 'ASC', |
138 | 138 | ] ); |
139 | 139 | |
140 | - return array_map( function ( $view ) { |
|
140 | + return array_map( function( $view ) { |
|
141 | 141 | return [ |
142 | - 'value' => (string) $view->ID, |
|
142 | + 'value' => (string)$view->ID, |
|
143 | 143 | 'label' => $view->post_title ?: strtr( _x( '#[view ID] (no title)', 'Placeholders inside [] are not to be translated.', 'gk-gravityview' ), [ '[view ID]' => $view->ID ] ) |
144 | 144 | ]; |
145 | 145 | }, $views ); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $newly_registered_styles = array_diff( $styles_after_shortcode, $styles_before_shortcode ); |
176 | 176 | |
177 | 177 | // This will return an array of all dependencies sorted in the order they should be loaded. |
178 | - $get_dependencies = function ( $handle, $source, $dependencies = [] ) use ( &$get_dependencies ) { |
|
178 | + $get_dependencies = function( $handle, $source, $dependencies = [ ] ) use ( &$get_dependencies ) { |
|
179 | 179 | if ( empty( $source->registered[ $handle ] ) ) { |
180 | 180 | return $dependencies; |
181 | 181 | } |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | return array_unique( array_flatten( $dependencies ) ); |
194 | 194 | }; |
195 | 195 | |
196 | - $script_dependencies = []; |
|
196 | + $script_dependencies = [ ]; |
|
197 | 197 | foreach ( $newly_registered_scripts as $script ) { |
198 | 198 | $script_dependencies = array_merge( $script_dependencies, $get_dependencies( $script, $wp_scripts ) ); |
199 | 199 | } |
200 | 200 | |
201 | - $style_dependencies = []; |
|
201 | + $style_dependencies = [ ]; |
|
202 | 202 | foreach ( $newly_registered_styles as $style ) { |
203 | 203 | $style_dependencies = array_merge( $style_dependencies, $get_dependencies( $style, $wp_styles ) ); |
204 | 204 | } |