File tree Expand file tree Collapse file tree 7 files changed +9
-8
lines changed
packages/block-library/src Expand file tree Collapse file tree 7 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ function gutenberg_create_initial_theme_features() {
3030}
3131add_action ( 'setup_theme ' , 'gutenberg_create_initial_theme_features ' , 0 );
3232
33- if ( ! function_exists ( 'wp_theme_element_class_name ' ) ) {
33+ if ( ! function_exists ( 'wp_theme_get_element_class_name ' ) ) {
3434 /**
3535 * Given an element name, returns a class name.
3636 * Alias from WP_Theme_JSON_Gutenberg::get_element_class_name.
@@ -41,7 +41,7 @@ function gutenberg_create_initial_theme_features() {
4141 *
4242 * @since 6.1.0
4343 */
44- function wp_theme_element_class_name ( $ element ) {
44+ function wp_theme_get_element_class_name ( $ element ) {
4545 return WP_Theme_JSON_Gutenberg::get_element_class_name ( $ element );
4646 }
4747}
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ function register_block_core_comments() {
109109 */
110110function comments_block_form_defaults ( $ fields ) {
111111 if ( wp_is_block_theme () ) {
112- $ fields ['submit_button ' ] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link ' . wp_theme_element_class_name ( 'button ' ) . '" value="%4$s" /> ' ;
112+ $ fields ['submit_button ' ] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link ' . wp_theme_get_element_class_name ( 'button ' ) . '" value="%4$s" /> ' ;
113113 $ fields ['submit_field ' ] = '<p class="form-submit wp-block-button">%1$s %2$s</p> ' ;
114114 }
115115
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ function register_block_core_post_comments_form() {
7272 */
7373function post_comments_form_block_form_defaults ( $ fields ) {
7474 if ( wp_is_block_theme () ) {
75- $ fields ['submit_button ' ] = '<input name="%1$s" type="submit" id="%2$s" class="wp-block-button__link ' . wp_theme_element_class_name ( 'button ' ) . '" value="%4$s" /> ' ;
75+ $ fields ['submit_button ' ] = '<input name="%1$s" type="submit" id="%2$s" class="wp-block-button__link ' . wp_theme_get_element_class_name ( 'button ' ) . '" value="%4$s" /> ' ;
7676 $ fields ['submit_field ' ] = '<p class="form-submit wp-block-button">%1$s %2$s</p> ' ;
7777 }
7878
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) {
175175 );
176176 }
177177
178- $ styles = gutenberg_style_engine_get_styles ( array ( 'border ' => $ border_styles ) );
178+ $ styles = wp_style_engine_get_styles ( array ( 'border ' => $ border_styles ) );
179179 $ attributes = array ();
180180 if ( ! empty ( $ styles ['classnames ' ] ) ) {
181181 $ attributes ['class ' ] = $ styles ['classnames ' ];
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ function render_block_core_search( $attributes ) {
121121 }
122122
123123 // Include the button element class.
124- $ button_classes [] = wp_theme_element_class_name ( 'button ' );
124+ $ button_classes [] = wp_theme_get_element_class_name ( 'button ' );
125125 $ button_markup = sprintf (
126126 '<button type="submit" class="%s" %s %s>%s</button> ' ,
127127 esc_attr ( implode ( ' ' , $ button_classes ) ),
Original file line number Diff line number Diff line change @@ -797,14 +797,14 @@ function test_remove_invalid_element_pseudo_selectors() {
797797
798798 function test_get_element_class_name_button () {
799799 $ expected = 'wp-element-button ' ;
800- $ actual = wp_theme_element_class_name ( 'button ' );
800+ $ actual = WP_Theme_JSON_Gutenberg:: get_element_class_name ( 'button ' );
801801
802802 $ this ->assertEquals ( $ expected , $ actual );
803803 }
804804
805805 function test_get_element_class_name_invalid () {
806806 $ expected = '' ;
807- $ actual = wp_theme_element_class_name ( 'unknown-element ' );
807+ $ actual = WP_Theme_JSON_Gutenberg:: get_element_class_name ( 'unknown-element ' );
808808
809809 $ this ->assertEquals ( $ expected , $ actual );
810810 }
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const blockViewRegex = new RegExp(
3030const prefixFunctions = [
3131 'build_query_vars_from_query_block' ,
3232 'wp_enqueue_block_support_styles' ,
33+ 'wp_style_engine_get_styles' ,
3334] ;
3435
3536/**
You can’t perform that action at this time.
0 commit comments