wp_content_img_tag WordPress Filter Hook

The wp_content_img_tag Wordpress hook allows you to modify the image tag output by the content editor when inserting an image into the post content. This can be useful for adding custom attributes to the image tag, or for changing the way the image is displayed.

apply_filters( 'wp_content_img_tag', string $filtered_image, string $context, int $attachment_id ) #

Filters an img tag within the content for a given context.


Parameters

$filtered_image

(string)Full img tag with attributes that will replace the source img tag.

$context

(string)Additional context, like the current filter name or the function name from where this was called.

$attachment_id

(int)The image attachment ID. May be 0 in case the image is not an attachment.


Top ↑

Source

File: wp-includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
6.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More