@@ -105,7 +105,7 @@ function auto_sizes_filter_image_tag( $content, array $parsed_block, WP_Block $b
105
105
* See https://github.com/WordPress/wordpress-develop/blob/3f9c6fce666ed2ea0d56c21f6235c37db3d91392/src/wp-includes/blocks/post-featured-image.php#L65
106
106
*/
107
107
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 ' ] );
109
109
}
110
110
111
111
/*
@@ -133,7 +133,7 @@ function auto_sizes_filter_image_tag( $content, array $parsed_block, WP_Block $b
133
133
* See https://github.com/WordPress/wordpress-develop/blob/3f9c6fce666ed2ea0d56c21f6235c37db3d91392/src/wp-includes/blocks/post-featured-image.php#L65
134
134
*/
135
135
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 ' ] );
137
137
}
138
138
139
139
$ sizes = wp_calculate_image_sizes (
@@ -382,14 +382,14 @@ function auto_sizes_filter_render_block_context( array $context, array $block, ?
382
382
}
383
383
384
384
/**
385
- * Retrieves the featured image ID for a post featured image block .
385
+ * Retrieves the featured image attachment ID for a given post ID .
386
386
*
387
- * @since n.e.x.t
387
+ * @since 1.4.0
388
388
*
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.
391
391
*/
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 {
393
393
if ( 0 === $ post_id ) {
394
394
return 0 ;
395
395
}
0 commit comments