Skip to content

Commit

Permalink
Revert "Gallery Block: Use wp_enqueue_block_support_styles() if possi…
Browse files Browse the repository at this point in the history
…ble (#43779)"

This reverts commit 0a51142.
  • Loading branch information
ockham authored Sep 5, 2022
1 parent 0a51142 commit ce2b07a
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/block-library/src/gallery/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +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 . '}';

// If we're on WordPress >= 6.1, we can use `wp_enqueue_block_support_styles`, as it supports
// `$priority` as its second argument. Otherwise, we have to fall back to using our
// `gutenberg_enqueue_block_support_styles` shim.
if (
function_exists( 'wp_enqueue_block_support_styles' ) &&
2 === count( ( new ReflectionFunction( 'wp_enqueue_block_support_styles' ) )->getParameters() )
) {
wp_enqueue_block_support_styles( $style, 11 );
} else {
gutenberg_enqueue_block_support_styles( $style, 11 );
}
gutenberg_enqueue_block_support_styles( $style, 11 );
return $content;
}
/**
Expand Down

0 comments on commit ce2b07a

Please sign in to comment.