Skip to content

Commit 25d95ea

Browse files
committed
Rename filter callbacks for consistency
1 parent 2f03e55 commit 25d95ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/auto-sizes/hooks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ function auto_sizes_render_generator(): void {
3838
add_filter( 'the_content', 'auto_sizes_prime_attachment_caches', 9 ); // This must run before 'do_blocks', which runs at priority 9.
3939
add_filter( 'render_block_core/image', 'auto_sizes_filter_image_tag', 10, 3 );
4040
add_filter( 'render_block_core/cover', 'auto_sizes_filter_image_tag', 10, 3 );
41-
add_filter( 'get_block_type_uses_context', 'auto_sizes_allowed_uses_context_for_image_blocks', 10, 2 );
42-
add_filter( 'render_block_context', 'auto_sizes_modify_render_block_context', 10, 2 );
41+
add_filter( 'get_block_type_uses_context', 'auto_sizes_filter_uses_context', 10, 2 );
42+
add_filter( 'render_block_context', 'auto_sizes_filter_render_block_context', 10, 2 );

plugins/auto-sizes/includes/improve-calculate-sizes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function auto_sizes_format_sizes_attribute( string $alignment, string $width ):
242242
* @param WP_Block_Type $block_type The full block type object.
243243
* @return array<string> The filtered context keys used by the block type.
244244
*/
245-
function auto_sizes_allowed_uses_context_for_image_blocks( array $uses_context, WP_Block_Type $block_type ): array {
245+
function auto_sizes_filter_uses_context( array $uses_context, WP_Block_Type $block_type ): array {
246246
if ( 'core/image' === $block_type->name ) {
247247
// Use array_values to reset the array keys after merging.
248248
return array_values( array_unique( array_merge( $uses_context, array( 'ancestor_block_align' ) ) ) );
@@ -259,7 +259,7 @@ function auto_sizes_allowed_uses_context_for_image_blocks( array $uses_context,
259259
* @param array<string, mixed> $block The block being rendered.
260260
* @return array<string, mixed> Modified block context.
261261
*/
262-
function auto_sizes_modify_render_block_context( array $context, array $block ): array {
262+
function auto_sizes_filter_render_block_context( array $context, array $block ): array {
263263
if ( 'core/group' === $block['blockName'] || 'core/columns' === $block['blockName'] ) {
264264
$context['ancestor_block_align'] = $block['attrs']['align'] ?? '';
265265
}

0 commit comments

Comments
 (0)