diff --git a/lib/compat/wordpress-6.1/theme.php b/lib/compat/wordpress-6.1/theme.php index 4787f1057b474..a36e48a14db96 100644 --- a/lib/compat/wordpress-6.1/theme.php +++ b/lib/compat/wordpress-6.1/theme.php @@ -30,7 +30,7 @@ function gutenberg_create_initial_theme_features() { } add_action( 'setup_theme', 'gutenberg_create_initial_theme_features', 0 ); -if ( ! function_exists( 'wp_theme_element_class_name' ) ) { +if ( ! function_exists( 'wp_theme_get_element_class_name' ) ) { /** * Given an element name, returns a class name. * Alias from WP_Theme_JSON_Gutenberg::get_element_class_name. @@ -41,7 +41,7 @@ function gutenberg_create_initial_theme_features() { * * @since 6.1.0 */ - function wp_theme_element_class_name( $element ) { + function wp_theme_get_element_class_name( $element ) { return WP_Theme_JSON_Gutenberg::get_element_class_name( $element ); } } diff --git a/packages/block-library/src/comments/index.php b/packages/block-library/src/comments/index.php index edc1bedab083f..69044c081c74e 100644 --- a/packages/block-library/src/comments/index.php +++ b/packages/block-library/src/comments/index.php @@ -109,7 +109,7 @@ function register_block_core_comments() { */ function comments_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { - $fields['submit_button'] = ''; + $fields['submit_button'] = ''; $fields['submit_field'] = '

%1$s %2$s

'; } diff --git a/packages/block-library/src/post-comments-form/index.php b/packages/block-library/src/post-comments-form/index.php index 4bbd24b245411..53a6f8b5242a9 100644 --- a/packages/block-library/src/post-comments-form/index.php +++ b/packages/block-library/src/post-comments-form/index.php @@ -72,7 +72,7 @@ function register_block_core_post_comments_form() { */ function post_comments_form_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { - $fields['submit_button'] = ''; + $fields['submit_button'] = ''; $fields['submit_field'] = '

%1$s %2$s

'; } diff --git a/packages/block-library/src/post-featured-image/index.php b/packages/block-library/src/post-featured-image/index.php index 788917d3d252e..552811f6d2f21 100644 --- a/packages/block-library/src/post-featured-image/index.php +++ b/packages/block-library/src/post-featured-image/index.php @@ -175,7 +175,7 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) { ); } - $styles = gutenberg_style_engine_get_styles( array( 'border' => $border_styles ) ); + $styles = wp_style_engine_get_styles( array( 'border' => $border_styles ) ); $attributes = array(); if ( ! empty( $styles['classnames'] ) ) { $attributes['class'] = $styles['classnames']; diff --git a/packages/block-library/src/search/index.php b/packages/block-library/src/search/index.php index 40cf5fcf5478f..46e08134b384d 100644 --- a/packages/block-library/src/search/index.php +++ b/packages/block-library/src/search/index.php @@ -121,7 +121,7 @@ function render_block_core_search( $attributes ) { } // Include the button element class. - $button_classes[] = wp_theme_element_class_name( 'button' ); + $button_classes[] = wp_theme_get_element_class_name( 'button' ); $button_markup = sprintf( '', esc_attr( implode( ' ', $button_classes ) ), diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php index 35c4bf153ddb2..42146c66e6635 100644 --- a/phpunit/class-wp-theme-json-test.php +++ b/phpunit/class-wp-theme-json-test.php @@ -797,14 +797,14 @@ function test_remove_invalid_element_pseudo_selectors() { function test_get_element_class_name_button() { $expected = 'wp-element-button'; - $actual = wp_theme_element_class_name( 'button' ); + $actual = WP_Theme_JSON_Gutenberg::get_element_class_name( 'button' ); $this->assertEquals( $expected, $actual ); } function test_get_element_class_name_invalid() { $expected = ''; - $actual = wp_theme_element_class_name( 'unknown-element' ); + $actual = WP_Theme_JSON_Gutenberg::get_element_class_name( 'unknown-element' ); $this->assertEquals( $expected, $actual ); } diff --git a/tools/webpack/blocks.js b/tools/webpack/blocks.js index 1113bb38589b6..c56ee6417da90 100644 --- a/tools/webpack/blocks.js +++ b/tools/webpack/blocks.js @@ -30,6 +30,7 @@ const blockViewRegex = new RegExp( const prefixFunctions = [ 'build_query_vars_from_query_block', 'wp_enqueue_block_support_styles', + 'wp_style_engine_get_styles', ]; /**