diff --git a/wp-includes/media.php b/wp-includes/media.php index a0e7ef9c6c..260db26cac 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1843,6 +1843,17 @@ function wp_filter_content_tags( $content, $context = null ) { $filtered_image = wp_img_tag_add_loading_attr( $filtered_image, $context ); } + /** + * Filters an img tag within the content for a given context. + * + * @since 6.0.0 + * + * @param string $filtered_image Full img tag with attributes that will replace the source img tag. + * @param string $context Additional context, like the current filter name or the function name from where this was called. + * @param int $attachment_id The image attachment ID. May be 0 in case the image is not an attachment. + */ + $filtered_image = apply_filters( 'wp_content_img_tag', $filtered_image, $context, $attachment_id ); + if ( $filtered_image !== $match[0] ) { $content = str_replace( $match[0], $filtered_image, $content ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 592fd337de..41f98c6889 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53027'; +$wp_version = '6.0-alpha-53028'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.