diff --git a/packages/block-library/src/gallery/index.php b/packages/block-library/src/gallery/index.php index 9f29184ffed07a..7bc5e2821b7968 100644 --- a/packages/block-library/src/gallery/index.php +++ b/packages/block-library/src/gallery/index.php @@ -104,7 +104,7 @@ function block_core_gallery_render( $attributes, $content ) { // Set the CSS variable to the column value, and the `gap` property to the combined gap value. $style = '.wp-block-gallery.' . $class . '{ --wp--style--unstable-gallery-gap: ' . $gap_column . '; gap: ' . $gap_value . '}'; - gutenberg_enqueue_block_support_styles( $style, 11 ); + wp_enqueue_block_support_styles( $style, 11 ); return $content; } /** diff --git a/tools/webpack/blocks.js b/tools/webpack/blocks.js index f37cb0472a647a..1113bb38589b61 100644 --- a/tools/webpack/blocks.js +++ b/tools/webpack/blocks.js @@ -27,7 +27,10 @@ const blockViewRegex = new RegExp( * but have been declared elsewhere. This way we can call Gutenberg override functions, but * the block will still call the core function when updates are back ported. */ -const prefixFunctions = [ 'build_query_vars_from_query_block' ]; +const prefixFunctions = [ + 'build_query_vars_from_query_block', + 'wp_enqueue_block_support_styles', +]; /** * Escapes the RegExp special characters. @@ -140,7 +143,11 @@ module.exports = { // block will still call the core function when updates are back ported. content = content.replace( new RegExp( prefixFunctions.join( '|' ), 'g' ), - ( match ) => `${ prefix }${ match }` + ( match ) => + `${ prefix }${ match.replace( + /^wp_/, + '' + ) }` ); // Within content, search for any function definitions. For