From af5876aaf400f914df8e563435e097f5e4c12dfb Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Sun, 19 May 2024 09:22:15 +1000 Subject: [PATCH] Update child layout selector to match core. (#61777) Co-authored-by: tellthemachines Co-authored-by: andrewserong --- lib/block-supports/layout.php | 2 +- phpunit/block-supports/layout-test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index aac62e402148a..dc5fe2e6a87da 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -577,7 +577,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) { // Child layout specific logic. if ( $child_layout ) { - $container_content_class = wp_unique_id( 'wp-container-content-' ); + $container_content_class = wp_unique_prefixed_id( 'wp-container-content-' ); $child_layout_declarations = array(); $child_layout_styles = array(); diff --git a/phpunit/block-supports/layout-test.php b/phpunit/block-supports/layout-test.php index 6344d7617aeeb..dd40283171e5c 100644 --- a/phpunit/block-supports/layout-test.php +++ b/phpunit/block-supports/layout-test.php @@ -501,7 +501,7 @@ public function data_layout_support_flag_renders_classnames_on_wrapper() { ), ), ), - 'expected_output' => '

Some text.

', // The generated classname number assumes `wp_unique_id` will not have run previously in this test. + 'expected_output' => '

Some text.

', // The generated classname number assumes `wp_unique_prefixed_id( 'wp-container-content-' )` will not have run previously in this test. ), ); }