]*>(.+)<\/p>/is', $block['innerHTML'], $matches ) ) { if ( ! empty( $matches[1] ) ) { @@ -19,7 +19,7 @@ public function to_strings( array $block ) : array { } // todo: this needs a fix to properly rebuild innerContent - see ParagraphParserTest - public function replace_strings( array $block, array $replacements ) : array { + public function replace_strings( array $block, array $replacements ): array { $this->set_attribute( 'placeholder', $block, $replacements ); $html = $block['innerHTML']; @@ -32,7 +32,7 @@ public function replace_strings( array $block, array $replacements ) : array { } $block['innerHTML'] = $html; - $block['innerContent'] = [ $html ]; + $block['innerContent'] = array( $html ); return $block; } diff --git a/public_html/wp-content/plugins/pattern-translations/includes/parsers/ShortcodeBlock.php b/public_html/wp-content/plugins/pattern-translations/includes/parsers/ShortcodeBlock.php index 18aaefcb0..6afcd5b50 100644 --- a/public_html/wp-content/plugins/pattern-translations/includes/parsers/ShortcodeBlock.php +++ b/public_html/wp-content/plugins/pattern-translations/includes/parsers/ShortcodeBlock.php @@ -10,14 +10,14 @@ class ShortcodeBlock implements BlockParser { use GetSetAttribute; - public $attribute_names = []; + public $attribute_names = array(); public function __construct( array $attribute_names ) { $this->attribute_names = $attribute_names; } - public function to_strings( array $block ) : array { - $strings = []; + public function to_strings( array $block ): array { + $strings = array(); foreach ( $this->attribute_names as $attribute_name ) { $strings = array_merge( $strings, $this->get_attribute( $attribute_name, $block ) ); } @@ -25,7 +25,7 @@ public function to_strings( array $block ) : array { return $strings; } - public function replace_strings( array $block, array $replacements ) : array { + public function replace_strings( array $block, array $replacements ): array { foreach ( $this->attribute_names as $attribute_name ) { $this->set_attribute( $attribute_name, $block, $replacements ); @@ -35,7 +35,7 @@ public function replace_strings( array $block, array $replacements ) : array { $block['innerContent'][ $i ] = preg_replace_callback( $shortcode_param_regex, - function( $matches ) use ( $replacements ) { + function ( $matches ) use ( $replacements ) { return $this->preg_replace_gutenberg_attributes_handler( $matches, $replacements ); }, $inner_content @@ -47,7 +47,7 @@ function( $matches ) use ( $replacements ) { $regex = '/\b(\w*?)="(.*?)(")/'; $block['innerHTML'] = preg_replace_callback( $regex, - function( $matches ) use ( $replacements ) { + function ( $matches ) use ( $replacements ) { return $this->preg_replace_gutenberg_attributes_handler( $matches, $replacements ); }, $block['innerHTML'] @@ -60,7 +60,7 @@ protected function snake_case( $camelCaseString ) { return ltrim( preg_replace_callback( '/([A-Z]+)/', - function( $matches ) { + function ( $matches ) { return '_' . strtolower( $matches[1] ); }, $camelCaseString ), diff --git a/public_html/wp-content/plugins/pattern-translations/includes/parsers/TextNode.php b/public_html/wp-content/plugins/pattern-translations/includes/parsers/TextNode.php index 1aec70829..f338e80d3 100644 --- a/public_html/wp-content/plugins/pattern-translations/includes/parsers/TextNode.php +++ b/public_html/wp-content/plugins/pattern-translations/includes/parsers/TextNode.php @@ -4,11 +4,11 @@ class TextNode implements BlockParser { use DomUtils; - public function to_strings( array $block ) : array { + public function to_strings( array $block ): array { $dom = $this->get_dom( serialize_block( $block ) ); $xpath = new \DOMXPath( $dom ); - $strings = []; + $strings = array(); foreach ( $xpath->query( '//text()' ) as $text ) { if ( trim( $text->nodeValue ) ) { @@ -19,7 +19,7 @@ public function to_strings( array $block ) : array { return $strings; } - public function replace_strings( array $block, array $replacements ) : array { + public function replace_strings( array $block, array $replacements ): array { $dom = $this->get_dom( serialize_block( $block ) ); $xpath = new \DOMXPath( $dom ); @@ -29,6 +29,6 @@ public function replace_strings( array $block, array $replacements ) : array { } } - return parse_blocks( $this->removeHtml( $dom->saveHTML() ) )[0] ?? []; + return parse_blocks( $this->removeHtml( $dom->saveHTML() ) )[0] ?? array(); } } diff --git a/public_html/wp-content/plugins/pattern-translations/includes/pattern.php b/public_html/wp-content/plugins/pattern-translations/includes/pattern.php index 148fce12f..58891d13f 100644 --- a/public_html/wp-content/plugins/pattern-translations/includes/pattern.php +++ b/public_html/wp-content/plugins/pattern-translations/includes/pattern.php @@ -1,7 +1,8 @@ to_strings() as $string ) { $translations[ $string ] = apply_filters( 'gettext', GlotPress_Translate_Bridge::translate( $string, GLOTPRESS_PROJECT ), 'wporg-pattern' ); @@ -68,17 +69,17 @@ public function to_locale( string $locale ) /* PHP8 : Pattern|bool */ { $translated->ID = 0; // Find the actual post ID of the translated pattern - $children = get_posts( [ + $children = get_posts( array( 'post_parent' => $parent->ID, 'post_type' => POST_TYPE, 'post_status' => 'any', - 'meta_query' => [ - [ + 'meta_query' => array( + array( 'key' => 'wpop_locale', 'value' => $locale, - ], - ], - ] ); + ), + ), + ) ); if ( $children ) { $post = array_shift( $children ); $translated->ID = $post->ID; @@ -94,7 +95,7 @@ public function to_locale( string $locale ) /* PHP8 : Pattern|bool */ { * @param \WP_Post $post The post object. * @return Pattern The Pattern object. */ - public static function from_post( \WP_Post $post ) : Pattern { + public static function from_post( \WP_Post $post ): Pattern { $pattern = new Pattern(); $pattern->ID = $post->ID; $pattern->title = $post->post_title; @@ -114,24 +115,24 @@ public static function from_post( \WP_Post $post ) : Pattern { * @param array $args The WP_Query args. * @return array An array of Pattern objects. */ - public static function get_patterns( array $args = [] ) : array { - $defaults = [ + public static function get_patterns( array $args = array() ): array { + $defaults = array( 'post_type' => POST_TYPE, // Note: This must be set for cli context, in isolated test context this is defaulted to 'publish' // Prevents unexpected patterns in translations 'post_status' => 'publish', 'posts_per_page' => -1, - 'orderby' => [ + 'orderby' => array( 'post_date' => 'DESC', - ], + ), // Only select en_US patterns. - 'meta_query' => [ - [ + 'meta_query' => array( + array( 'key' => 'wpop_locale', 'value' => 'en_US', - ], - ], - ]; + ), + ), + ); $options = wp_parse_args( $args, $defaults ); @@ -141,7 +142,7 @@ public static function get_patterns( array $args = [] ) : array { wp_reset_postdata(); if ( 'ids' !== $query->get( 'fields' ) ) { - $patterns = array_map( [ self::class, 'from_post' ], $patterns ); + $patterns = array_map( array( self::class, 'from_post' ), $patterns ); } return $patterns; diff --git a/public_html/wp-content/plugins/pattern-translations/pattern-translations.php b/public_html/wp-content/plugins/pattern-translations/pattern-translations.php index d01b1be88..28439fc32 100644 --- a/public_html/wp-content/plugins/pattern-translations/pattern-translations.php +++ b/public_html/wp-content/plugins/pattern-translations/pattern-translations.php @@ -11,11 +11,11 @@ const GLOTPRESS_PROJECT = 'patterns/core'; -const TRANSLATED_TAXONOMIES = [ +const TRANSLATED_TAXONOMIES = array( // Taxonomy => Translation Context, see pattern-directory/bin/i18n.php 'wporg-pattern-category' => 'Categories term name', 'wporg-pattern-flag-reason' => 'Flag Reasons term name', -]; +); require __DIR__ . '/includes/pattern.php'; require __DIR__ . '/includes/parser.php'; @@ -36,7 +36,7 @@ function create_or_update_translated_pattern( Pattern $pattern ) { $parent = get_post( $pattern->parent->ID ); } - $args = [ + $args = array( 'ID' => $pattern->ID, 'post_type' => POST_TYPE, 'post_title' => $pattern->title, @@ -46,7 +46,7 @@ function create_or_update_translated_pattern( Pattern $pattern ) { 'post_parent' => $pattern->parent->ID ?? 0, 'post_author' => $parent->post_author ?? 0, 'post_status' => $parent->post_status ?? 'pending', - 'meta_input' => [ + 'meta_input' => array( 'wpop_description' => $pattern->description, 'wpop_locale' => $pattern->locale, 'wpop_keywords' => $pattern->keywords, @@ -55,8 +55,8 @@ function create_or_update_translated_pattern( Pattern $pattern ) { 'wpop_contains_block_types' => $parent->wpop_contains_block_types, 'wpop_wp_version' => $parent->wpop_wp_version, 'wpop_is_translation' => true, - ], - ]; + ), + ); if ( ! $args['ID'] ) { unset( $args['ID'] ); @@ -66,8 +66,8 @@ function create_or_update_translated_pattern( Pattern $pattern ) { // Copy the terms from the parent if required. if ( $post_id && ! is_wp_error( $post_id ) && $pattern->parent ) { - foreach ( [ 'wporg-pattern-category', 'wporg-pattern-keyword' ] as $taxonomy ) { - $term_ids = wp_get_object_terms( $pattern->parent->ID, $taxonomy, [ 'fields' => 'ids' ] ); + foreach ( array( 'wporg-pattern-category', 'wporg-pattern-keyword' ) as $taxonomy ) { + $term_ids = wp_get_object_terms( $pattern->parent->ID, $taxonomy, array( 'fields' => 'ids' ) ); wp_set_object_terms( $post_id, $term_ids, $taxonomy ); } } diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php index 3e1d2197f..a9d4f79cd 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/functions.php @@ -3,22 +3,22 @@ namespace WordPressdotorg\Theme\Pattern_Directory_2024; use function WordPressdotorg\Pattern_Directory\Favorite\{get_favorites, get_favorite_count}; +use function WordPressdotorg\Theme\Pattern_Directory_2024\Block_Config\get_applied_filter_list; use const WordPressdotorg\Pattern_Directory\Pattern_Post_Type\POST_TYPE; use const WordPressdotorg\Pattern_Directory\Pattern_Flag_Post_Type\POST_TYPE as FLAG_POST_TYPE; use const WordPressdotorg\Pattern_Directory\Pattern_Flag_Post_Type\PENDING_STATUS; -use function WordPressdotorg\Theme\Pattern_Directory_2024\Block_Config\get_applied_filter_list; // Block files -require_once( __DIR__ . '/src/blocks/copy-button/index.php' ); -require_once( __DIR__ . '/src/blocks/delete-button/index.php' ); -require_once( __DIR__ . '/src/blocks/pattern-preview/index.php' ); -require_once( __DIR__ . '/src/blocks/pattern-thumbnail/index.php' ); -require_once( __DIR__ . '/src/blocks/post-status/index.php' ); -require_once( __DIR__ . '/src/blocks/report-pattern/index.php' ); -require_once( __DIR__ . '/src/blocks/status-notice/index.php' ); +require_once __DIR__ . '/src/blocks/copy-button/index.php'; +require_once __DIR__ . '/src/blocks/delete-button/index.php'; +require_once __DIR__ . '/src/blocks/pattern-preview/index.php'; +require_once __DIR__ . '/src/blocks/pattern-thumbnail/index.php'; +require_once __DIR__ . '/src/blocks/post-status/index.php'; +require_once __DIR__ . '/src/blocks/report-pattern/index.php'; +require_once __DIR__ . '/src/blocks/status-notice/index.php'; -require_once( __DIR__ . '/inc/block-config.php' ); -require_once( __DIR__ . '/inc/shortcodes.php' ); +require_once __DIR__ . '/inc/block-config.php'; +require_once __DIR__ . '/inc/shortcodes.php'; /** * Actions and filters. @@ -37,7 +37,7 @@ add_action( 'init', - function() { + function () { // Don't swap author link with w.org profile link. remove_all_filters( 'author_link' ); @@ -175,13 +175,13 @@ function modify_patterns_query( $query ) { } if ( $curation ) { - $tax_query = isset( $query->tax_query->queries ) ? $query->tax_query->queries : []; + $tax_query = isset( $query->tax_query->queries ) ? $query->tax_query->queries : array(); if ( 'core' === $curation ) { // Patterns with the core keyword. $tax_query['core_keyword'] = array( 'taxonomy' => 'wporg-pattern-keyword', 'field' => 'slug', - 'terms' => [ 'core' ], + 'terms' => array( 'core' ), 'operator' => 'IN', ); } else if ( 'community' === $curation ) { @@ -189,7 +189,7 @@ function modify_patterns_query( $query ) { $tax_query['core_keyword'] = array( 'taxonomy' => 'wporg-pattern-keyword', 'field' => 'slug', - 'terms' => [ 'core' ], + 'terms' => array( 'core' ), 'operator' => 'NOT IN', ); } @@ -265,7 +265,7 @@ function modify_query_loop_block_query_vars( $query, $block, $page ) { $query['tax_query']['core_keyword'] = array( 'taxonomy' => 'wporg-pattern-keyword', 'field' => 'slug', - 'terms' => [ 'core' ], + 'terms' => array( 'core' ), 'operator' => 'NOT IN', ); } @@ -277,7 +277,7 @@ function modify_query_loop_block_query_vars( $query, $block, $page ) { } // Query Loops on My Patterns & Favorites pages - if ( is_page( [ 'my-patterns', 'favorites' ] ) ) { + if ( is_page( array( 'my-patterns', 'favorites' ) ) ) { // Get these values from the global wp_query, they're passed via the URL. if ( isset( $wp_query->query['pattern-categories'] ) ) { if ( ! isset( $query['tax_query'] ) || ! is_array( $query['tax_query'] ) ) { @@ -310,7 +310,7 @@ function modify_query_loop_block_query_vars( $query, $block, $page ) { $query['post_status'] = 'any'; $query['author'] = get_current_user_id(); } else { - $query['post__in'] = [ -1 ]; + $query['post__in'] = array( -1 ); } if ( isset( $wp_query->query['status'] ) ) { @@ -323,7 +323,7 @@ function modify_query_loop_block_query_vars( $query, $block, $page ) { if ( ! empty( $favorites ) ) { $query['post__in'] = get_favorites(); } else { - $query['post__in'] = [ -1 ]; + $query['post__in'] = array( -1 ); } } } @@ -360,7 +360,7 @@ function custom_query_loop_by_id( $query, $block ) { $current_post = get_post(); if ( 'more-by-author' === $block->context['query']['_id'] && $current_post && $current_post->post_author ) { $query['author'] = $current_post->post_author; - $query['post__not_in'] = [ $current_post->ID ]; + $query['post__not_in'] = array( $current_post->ID ); $query['post_type'] = 'wporg-pattern'; } @@ -456,7 +456,7 @@ function redirect_term_archives() { if ( count( $terms ) === 1 && ! $is_term_archive ) { $url = get_term_link( $terms[0] ); // Pass through search query, curation, sorting values. - $query_vars = [ 's', 'curation', 'order', 'orderby' ]; + $query_vars = array( 's', 'curation', 'order', 'orderby' ); foreach ( $query_vars as $query_var ) { if ( isset( $wp_query->query[ $query_var ] ) ) { $url = add_query_arg( $query_var, $wp_query->query[ $query_var ], $url ); @@ -471,37 +471,37 @@ function redirect_term_archives() { * Add meta tags for richer social media integrations. */ function add_social_meta_tags() { - $og_fields = []; + $og_fields = array(); $default_image = 'https://s.w.org/patterns/files/2024/04/patterns-ogimage.png'; $site_title = function_exists( '\WordPressdotorg\site_brand' ) ? \WordPressdotorg\site_brand() : 'WordPress.org'; if ( is_front_page() || is_home() ) { - $og_fields = [ + $og_fields = array( 'og:title' => __( 'Block Pattern Directory', 'wporg-patterns' ), 'og:description' => __( 'Add a beautifully designed, ready to go layout to any WordPress site with a simple copy/paste.', 'wporg-patterns' ), 'og:site_name' => $site_title, 'og:type' => 'website', 'og:url' => home_url(), 'og:image' => esc_url( $default_image ), - ]; + ); } else if ( is_tax() && get_queried_object() ) { - $og_fields = [ + $og_fields = array( 'og:title' => sprintf( __( 'Block Patterns: %s', 'wporg-patterns' ), esc_attr( single_term_title( '', false ) ) ), 'og:description' => __( 'Add a beautifully designed, ready to go layout to any WordPress site with a simple copy/paste.', 'wporg-patterns' ), 'og:site_name' => $site_title, 'og:type' => 'website', 'og:url' => esc_url( get_term_link( get_queried_object_id() ) ), 'og:image' => esc_url( $default_image ), - ]; + ); } else if ( is_singular( POST_TYPE ) ) { - $og_fields = [ + $og_fields = array( 'og:title' => the_title_attribute( array( 'echo' => false ) ), 'og:description' => strip_tags( get_post_meta( get_the_ID(), 'wpop_description', true ) ), 'og:site_name' => $site_title, 'og:type' => 'website', 'og:url' => esc_url( get_permalink() ), 'og:image' => esc_url( $default_image ), - ]; + ); printf( '' . "\n" ); printf( '' . "\n" ); printf( '' . "\n", esc_url( $default_image ) ); diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php index 207a184e2..1f0419e00 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/block-config.php @@ -35,8 +35,8 @@ function register_block_bindings() { 'wporg-pattern/edit-label', array( 'label' => __( 'Edit label', 'wporg-patterns' ), - 'uses_context' => [ 'postId' ], - 'get_value_callback' => function( $args, $block ) { + 'uses_context' => array( 'postId' ), + 'get_value_callback' => function ( $args, $block ) { $post_id = $block->context['postId']; /* translators: %s: Post title. Only visible to screen readers. */ return sprintf( @@ -51,8 +51,8 @@ function register_block_bindings() { 'wporg-pattern/edit-url', array( 'label' => __( 'Edit link', 'wporg-patterns' ), - 'uses_context' => [ 'postId' ], - 'get_value_callback' => function( $args, $block ) { + 'uses_context' => array( 'postId' ), + 'get_value_callback' => function ( $args, $block ) { $post_id = $block->context['postId']; return site_url( "pattern/$post_id/edit/" ); }, @@ -70,10 +70,10 @@ function register_block_bindings() { */ function get_applied_filter_list( $include_extras = true ) { global $wp_query; - $terms = []; - $taxes = [ + $terms = array(); + $taxes = array( 'pattern-categories' => 'wporg-pattern-category', - ]; + ); foreach ( $taxes as $query_var => $taxonomy ) { if ( ! isset( $wp_query->query[ $query_var ] ) ) { continue; @@ -178,7 +178,7 @@ function get_curation_options( $options ) { 'community' => _x( 'Community', 'filter option label', 'wporg-patterns' ), 'core' => _x( 'Curated', 'filter option label', 'wporg-patterns' ), ), - 'selected' => [ $current ], + 'selected' => array( $current ), ); } @@ -218,7 +218,7 @@ function get_sort_options( $options ) { ); // These pages don't support sorting by favorite count. - if ( ! is_page( [ 'my-patterns', 'favorites' ] ) ) { + if ( ! is_page( array( 'my-patterns', 'favorites' ) ) ) { $options = array_merge( array( 'favorite_count_desc' => __( 'Popular', 'wporg-patterns' ), @@ -233,7 +233,7 @@ function get_sort_options( $options ) { 'key' => 'orderby', 'action' => get_filter_action_url(), 'options' => $options, - 'selected' => [ $sort ], + 'selected' => array( $sort ), ); } @@ -250,7 +250,7 @@ function inject_other_filters( $key ) { global $wp_query; // Single-select query parameters. - $query_vars = [ 'pattern-categories', 'order', 'orderby', 'curation' ]; + $query_vars = array( 'pattern-categories', 'order', 'orderby', 'curation' ); foreach ( $query_vars as $query_var ) { if ( ! isset( $wp_query->query[ $query_var ] ) ) { continue; @@ -286,7 +286,7 @@ function get_favorite_settings( $settings, $post_id ) { return array( 'count' => get_favorite_count( $post_id ), 'is_favorite' => is_favorite( $post_id ), - 'add_callback' => function( $_post_id ) { + 'add_callback' => function ( $_post_id ) { $success = add_favorite( $_post_id ); if ( $success ) { return get_favorite_count( $_post_id ); @@ -298,7 +298,7 @@ function get_favorite_settings( $settings, $post_id ) { array( 'status' => 500 ) ); }, - 'delete_callback' => function( $_post_id ) { + 'delete_callback' => function ( $_post_id ) { $success = remove_favorite( $_post_id ); if ( $success ) { return get_favorite_count( $_post_id ); diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/shortcodes.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/shortcodes.php index a71c53cae..b9a430548 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/shortcodes.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/inc/shortcodes.php @@ -1,4 +1,8 @@ $current_post_id, 'message' => __( 'Are you sure you want to delete this pattern?', 'wporg-patterns' ), 'redirectUrl' => home_url( '/my-patterns/' ), -]; +); $encoded_state = wp_json_encode( $init_state ); ?> diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/controls/render.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/controls/render.php index 7b8f86b14..5a8b89d02 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/controls/render.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/controls/render.php @@ -9,12 +9,12 @@ $view_url = get_pattern_preview_url( $block->context['postId'] ); // Initial state to pass to Interactivity API. -$init_state = [ +$init_state = array( 'url' => $view_url, 'previewWidth' => 1200, 'previewHeight' => 200, 'isControlled' => true, -]; +); $encoded_state = wp_json_encode( $init_state ); // Remove the nested context for child blocks, so that it uses this context. diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/frame/render.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/frame/render.php index b15cfed91..358c57112 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/frame/render.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-preview/frame/render.php @@ -14,12 +14,12 @@ } // Initial state to pass to Interactivity API. -$init_state = [ +$init_state = array( 'url' => $view_url, 'previewWidth' => $viewport_width, 'previewHeight' => 200, 'isControlled' => false, -]; +); $encoded_state = wp_json_encode( $init_state ); ?> diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-thumbnail/render.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-thumbnail/render.php index dd53fc7ba..414560702 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-thumbnail/render.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/pattern-thumbnail/render.php @@ -32,14 +32,14 @@ ); // Initial state to pass to Interactivity API. -$init_state = [ +$init_state = array( 'base64Image' => '', 'src' => esc_url( $url ), 'alt' => the_title_attribute( array( 'echo' => false ) ), 'attempts' => 0, 'shouldRetry' => true, 'hasError' => false, -]; +); $encoded_state = wp_json_encode( $init_state ); $classname = ''; diff --git a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/post-status/index.php b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/post-status/index.php index f74af5f07..cf5ed8963 100644 --- a/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/post-status/index.php +++ b/public_html/wp-content/themes/wporg-pattern-directory-2024/src/blocks/post-status/index.php @@ -64,6 +64,6 @@ function render( $attributes, $content, $block ) { return ''; } - $wrapper_attributes = get_block_wrapper_attributes( [ 'class' => 'is-' . $type ] ); + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'is-' . $type ) ); return sprintf( '