@@ -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' => 'id', |
| 42 | 42 | 'postId' => 'post_id', |
@@ -54,17 +54,17 @@ discard block |
||
| 54 | 54 | 'backLinkLabel' => 'back_link_label', |
| 55 | 55 | ]; |
| 56 | 56 | |
| 57 | - if ( isset( $block_attributes['searchOperator'] ) && empty( $block_attributes['searchValue'] ) ) { |
|
| 58 | - unset( $block_attributes['searchOperator'] ); |
|
| 57 | + if ( isset( $block_attributes[ 'searchOperator' ] ) && empty( $block_attributes[ 'searchValue' ] ) ) { |
|
| 58 | + unset( $block_attributes[ 'searchOperator' ] ); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $shortcode_attributes = []; |
|
| 61 | + $shortcode_attributes = [ ]; |
|
| 62 | 62 | |
| 63 | 63 | foreach ( $block_attributes as $attribute => $value ) { |
| 64 | 64 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 65 | 65 | |
| 66 | 66 | if ( isset( $block_to_shortcode_attributes_map[ $attribute ] ) && ! empty( $value ) ) { |
| 67 | - $shortcode_attributes[] = "{$block_to_shortcode_attributes_map[$attribute]}={$value}"; |
|
| 67 | + $shortcode_attributes[ ] = "{$block_to_shortcode_attributes_map[ $attribute ]}={$value}"; |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $rendered_shortcode = Blocks::render_shortcode( $shortcode ); |
| 78 | 78 | |
| 79 | 79 | if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) { |
| 80 | - return $rendered_shortcode['content']; |
|
| 80 | + return $rendered_shortcode[ 'content' ]; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | return json_encode( $rendered_shortcode ); |
@@ -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' => 'b01b31f57233994b6e45'); |
|
| 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' => 'b01b31f57233994b6e45' ); |
|