Skip to content

Commit bce8d44

Browse files
Update function name
1 parent 4e43f97 commit bce8d44

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function auto_sizes_filter_image_tag( $content, array $parsed_block, WP_Block $b
105105
* See https://github.com/WordPress/wordpress-develop/blob/3f9c6fce666ed2ea0d56c21f6235c37db3d91392/src/wp-includes/blocks/post-featured-image.php#L65
106106
*/
107107
if ( 'core/post-featured-image' === $block->name && isset( $block->context['postId'] ) ) {
108-
$id = auto_sizes_get_featured_image_id_from_block( $block->context['postId'] );
108+
$id = auto_sizes_get_featured_image_attachment_id( $block->context['postId'] );
109109
}
110110

111111
/*
@@ -133,7 +133,7 @@ function auto_sizes_filter_image_tag( $content, array $parsed_block, WP_Block $b
133133
* See https://github.com/WordPress/wordpress-develop/blob/3f9c6fce666ed2ea0d56c21f6235c37db3d91392/src/wp-includes/blocks/post-featured-image.php#L65
134134
*/
135135
if ( 'core/post-featured-image' === $block->name && isset( $block->context['postId'] ) ) {
136-
$id = auto_sizes_get_featured_image_id_from_block( $block->context['postId'] );
136+
$id = auto_sizes_get_featured_image_attachment_id( $block->context['postId'] );
137137
}
138138

139139
$sizes = wp_calculate_image_sizes(
@@ -382,14 +382,14 @@ function auto_sizes_filter_render_block_context( array $context, array $block, ?
382382
}
383383

384384
/**
385-
* Retrieves the featured image ID for a post featured image block.
385+
* Retrieves the featured image attachment ID for a given post ID.
386386
*
387-
* @since n.e.x.t
387+
* @since 1.4.0
388388
*
389-
* @param int $post_id The post id.
390-
* @return int The featured image ID or 0 if not found.
389+
* @param int $post_id The post ID.
390+
* @return int The featured image attachment ID or 0 if not found.
391391
*/
392-
function auto_sizes_get_featured_image_id_from_block( int $post_id ): int {
392+
function auto_sizes_get_featured_image_attachment_id( int $post_id ): int {
393393
if ( 0 === $post_id ) {
394394
return 0;
395395
}

0 commit comments

Comments
 (0)