@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 56 | 56 | |
| 57 | 57 | if ( in_array( $attribute, $accepted_attributes ) && ! empty( $value ) ) { |
| 58 | - $shortcode_attributes[] = "{$attribute}={$value}"; |
|
| 58 | + $shortcode_attributes[ ] = "{$attribute}={$value}"; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -43,15 +43,15 @@ |
||
| 43 | 43 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 44 | 44 | |
| 45 | 45 | if ( 'content' !== $attribute && in_array( $attribute, $accepted_attributes ) && ! empty( $value ) ) { |
| 46 | - $shortcode_attributes[] = "{$attribute}={$value}"; |
|
| 46 | + $shortcode_attributes[ ] = "{$attribute}={$value}"; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if ( ! empty( $attributes['content'] ) ) { |
|
| 50 | + if ( ! empty( $attributes[ 'content' ] ) ) { |
|
| 51 | 51 | $shortcode = sprintf( |
| 52 | 52 | '[gv_entry_link %s]%s[/gv_entry_link]', |
| 53 | 53 | implode( ' ', $shortcode_attributes ), |
| 54 | - wp_kses_post( $attributes['content'] ) |
|
| 54 | + wp_kses_post( $attributes[ 'content' ] ) |
|
| 55 | 55 | ); |
| 56 | 56 | } else { |
| 57 | 57 | $shortcode = sprintf( '[gv_entry_link %s/]', implode( ' ', $shortcode_attributes ) ); |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | global $wp_version; |
| 21 | 21 | |
| 22 | 22 | if ( ! class_exists( 'GravityView_Plugin' ) || |
| 23 | - ! function_exists( 'register_block_type' ) || |
|
| 24 | - version_compare( $wp_version, self::MIN_WP_VERSION, '<' ) |
|
| 23 | + ! function_exists( 'register_block_type' ) || |
|
| 24 | + version_compare( $wp_version, self::MIN_WP_VERSION, '<' ) |
|
| 25 | 25 | ) { |
| 26 | 26 | return; |
| 27 | 27 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | wp_enqueue_script( |
| 92 | 92 | self::ASSETS_HANDLE, |
| 93 | 93 | gravityview()->plugin->url() . $script, |
| 94 | - $asset_file['dependencies'], |
|
| 94 | + $asset_file[ 'dependencies' ], |
|
| 95 | 95 | filemtime( gravityview()->plugin->dir() . $script ) |
| 96 | 96 | ); |
| 97 | 97 | |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | ) |
| 110 | 110 | ); |
| 111 | 111 | |
| 112 | - $views_list_array = array_map( function ( $view ) { |
|
| 112 | + $views_list_array = array_map( function( $view ) { |
|
| 113 | 113 | |
| 114 | - $post_title = empty( $view->post_title ) ? __('(no title)', 'gk-gravityview') : $view->post_title; |
|
| 115 | - $post_title = esc_html( sprintf('%s #%d', $post_title, $view->ID ) ); |
|
| 114 | + $post_title = empty( $view->post_title ) ? __( '(no title)', 'gk-gravityview' ) : $view->post_title; |
|
| 115 | + $post_title = esc_html( sprintf( '%s #%d', $post_title, $view->ID ) ); |
|
| 116 | 116 | |
| 117 | 117 | return array( |
| 118 | 118 | 'value' => $view->ID, |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 56 | 56 | |
| 57 | 57 | if ( in_array( $attribute, $accepted_attributes ) && ! empty( $value ) ) { |
| 58 | - $shortcode_attributes[] = "{$attribute}={$value}"; |
|
| 58 | + $shortcode_attributes[ ] = "{$attribute}={$value}"; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 56 | 56 | |
| 57 | 57 | if ( in_array( $attribute, $accepted_attributes ) && ! empty( $value ) ) { |
| 58 | - $shortcode_attributes[] = "{$attribute}={$value}"; |
|
| 58 | + $shortcode_attributes[ ] = "{$attribute}={$value}"; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $value = esc_attr( sanitize_text_field( $value ) ); |
| 56 | 56 | |
| 57 | 57 | if ( in_array( $attribute, $accepted_attributes ) && ! empty( $value ) ) { |
| 58 | - $shortcode_attributes[] = "{$attribute}={$value}"; |
|
| 58 | + $shortcode_attributes[ ] = "{$attribute}={$value}"; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -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; |
@@ -117,7 +117,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -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( |
|
| 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 |
||
| 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 | } |
@@ -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( |
|
| 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 |
||
| 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 | } |