Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_content_img_tag

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
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 );
1856
1857                if ( $filtered_image !== $match[0] ) {
1858                     $content = str_replace( $match[0], $filtered_image, $content );
1859                }
1860
1861                /*
1862                 * Unset image lookup to not run the same logic again unnecessarily if the same image tag is used more than
1863                 * once in the same blob of content.
1864                 */