Changeset 53028
- Timestamp:
- 03/29/2022 11:56:18 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r52957 r53028 1843 1843 $filtered_image = wp_img_tag_add_loading_attr( $filtered_image, $context ); 1844 1844 } 1845 1846 /** 1847 * Filters an img tag within the content for a given context. 1848 * 1849 * @since 6.0.0 1850 * 1851 * @param string $filtered_image Full img tag with attributes that will replace the source img tag. 1852 * @param string $context Additional context, like the current filter name or the function name from where this was called. 1853 * @param int $attachment_id The image attachment ID. May be 0 in case the image is not an attachment. 1854 */ 1855 $filtered_image = apply_filters( 'wp_content_img_tag', $filtered_image, $context, $attachment_id ); 1845 1856 1846 1857 if ( $filtered_image !== $match[0] ) { -
trunk/tests/phpunit/tests/media.php
r52190 r53028 2295 2295 2296 2296 /** 2297 * @ticket 55347 2298 */ 2299 public function test_wp_filter_content_tags_has_filter() { 2300 $filter = new MockAction(); 2301 add_filter( 'wp_content_img_tag', array( &$filter, 'filter' ) ); 2302 $img_tag_1 = get_image_tag( self::$large_id, '', '', '', 'medium' ); 2303 2304 wp_filter_content_tags( $img_tag_1 ); 2305 $this->assertSame( 1, $filter->get_call_count() ); 2306 } 2307 /** 2297 2308 * @ticket 33641 2298 2309 * @ticket 34528
Note: See TracChangeset
for help on using the changeset viewer.