@@ -33,20 +33,20 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @return string $output |
| 35 | 35 | */ |
| 36 | - static function render( $block_attributes = [] ) { |
|
| 36 | + static function render( $block_attributes = [ ] ) { |
|
| 37 | 37 | $block_to_shortcode_attributes_map = [ |
| 38 | 38 | 'view_id' => 'id', |
| 39 | 39 | 'detail' => 'detail', |
| 40 | 40 | |
| 41 | 41 | ]; |
| 42 | 42 | |
| 43 | - $shortcode_attributes = []; |
|
| 43 | + $shortcode_attributes = [ ]; |
|
| 44 | 44 | |
| 45 | 45 | foreach ( $block_attributes as $attribute => $value ) { |
| 46 | 46 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 47 | 47 | |
| 48 | 48 | if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) { |
| 49 | - $shortcode_attributes[] = sprintf( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
| 49 | + $shortcode_attributes[ ] = sprintf( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @return string $output |
| 35 | 35 | */ |
| 36 | - static function render( $block_attributes = [] ) { |
|
| 36 | + static function render( $block_attributes = [ ] ) { |
|
| 37 | 37 | $block_to_shortcode_attributes_map = [ |
| 38 | 38 | 'view_id' => 'view_id', |
| 39 | 39 | 'entry_id' => 'entry_id', |
@@ -45,21 +45,21 @@ discard block |
||
| 45 | 45 | 'content' => 'content', |
| 46 | 46 | ]; |
| 47 | 47 | |
| 48 | - $shortcode_attributes = []; |
|
| 48 | + $shortcode_attributes = [ ]; |
|
| 49 | 49 | |
| 50 | 50 | foreach ( $block_attributes as $attribute => $value ) { |
| 51 | 51 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 52 | 52 | |
| 53 | 53 | if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) { |
| 54 | - $shortcode_attributes[] = sprintf( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
| 54 | + $shortcode_attributes[ ] = sprintf( '%s="%s"', $block_to_shortcode_attributes_map[ $attribute ], $value ); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ( ! empty( $block_attributes['content'] ) ) { |
|
| 58 | + if ( ! empty( $block_attributes[ 'content' ] ) ) { |
|
| 59 | 59 | $shortcode = sprintf( |
| 60 | 60 | '[gv_entry_link %s]%s[/gv_entry_link]', |
| 61 | 61 | implode( ' ', $shortcode_attributes ), |
| 62 | - wp_kses_post( $block_attributes['content'] ) |
|
| 62 | + wp_kses_post( $block_attributes[ 'content' ] ) |
|
| 63 | 63 | ); |
| 64 | 64 | } else { |
| 65 | 65 | $shortcode = sprintf( '[gv_entry_link %s/]', implode( ' ', $shortcode_attributes ) ); |
@@ -57,16 +57,16 @@ discard block |
||
| 57 | 57 | $block_class = array_values( array_diff( get_declared_classes(), $declared_classes ) ); |
| 58 | 58 | |
| 59 | 59 | if ( ! empty( $block_class ) ) { |
| 60 | - $block_class = new $block_class[0](); |
|
| 60 | + $block_class = new $block_class[ 0 ](); |
|
| 61 | 61 | |
| 62 | 62 | if ( is_callable( [ $block_class, 'modify_block_meta' ] ) ) { |
| 63 | 63 | $block_meta = array_merge( $block_meta, $block_class->modify_block_meta( $block_meta ) ); |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if ( ! empty( $block_meta['localization'] ) ) { |
|
| 68 | - add_filter( 'gk/gravityview/gutenberg/blocks/localization', function ( $localization ) use ( $block_meta ) { |
|
| 69 | - $localization[ $block_meta['name'] ] = $block_meta['localization']; |
|
| 67 | + if ( ! empty( $block_meta[ 'localization' ] ) ) { |
|
| 68 | + add_filter( 'gk/gravityview/gutenberg/blocks/localization', function( $localization ) use ( $block_meta ) { |
|
| 69 | + $localization[ $block_meta[ 'name' ] ] = $block_meta[ 'localization' ]; |
|
| 70 | 70 | |
| 71 | 71 | return $localization; |
| 72 | 72 | } ); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | 'views' => $this->get_views() |
| 117 | 117 | ] ); |
| 118 | 118 | |
| 119 | - wp_register_script( self::ASSETS_HANDLE, false, [] ); |
|
| 119 | + wp_register_script( self::ASSETS_HANDLE, false, [ ] ); |
|
| 120 | 120 | |
| 121 | 121 | wp_enqueue_script( self::ASSETS_HANDLE ); |
| 122 | 122 | |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | 'order' => 'ASC', |
| 139 | 139 | ] ); |
| 140 | 140 | |
| 141 | - return array_map( function ( $view ) { |
|
| 141 | + return array_map( function( $view ) { |
|
| 142 | 142 | return [ |
| 143 | - 'value' => (string) $view->ID, |
|
| 143 | + 'value' => (string)$view->ID, |
|
| 144 | 144 | 'label' => $view->post_title, |
| 145 | 145 | ]; |
| 146 | 146 | }, $views ); |
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '9eab881beb6c99f1cd27'); |
|
| 1 | +<?php return array( 'dependencies' => array( 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render' ), 'version' => '9eab881beb6c99f1cd27' ); |
|
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '3fd5e1442d41c8b3ed76'); |
|
| 1 | +<?php return array( 'dependencies' => array( 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render' ), 'version' => '3fd5e1442d41c8b3ed76' ); |
|
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '71db5e67a65a59803236'); |
|
| 1 | +<?php return array( 'dependencies' => array( 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render' ), 'version' => '71db5e67a65a59803236' ); |
|
@@ -1,1 +1,1 @@ |
||
| 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-server-side-render'), 'version' => 'd65a03239f213124f1ba'); |
|
| 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-server-side-render' ), 'version' => 'd65a03239f213124f1ba' ); |
|
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '27ccef3d28469d8e30bf'); |
|
| 1 | +<?php return array( 'dependencies' => array( 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render' ), 'version' => '27ccef3d28469d8e30bf' ); |
|