_filter_do_shortcode_context(): string

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Filter the wp_get_attachment_image_context hook during shortcode rendering.

Description

When wp_get_attachment_image() is called during shortcode rendering, we need to make clear that the context is a shortcode and not part of the theme’s template rendering logic.

Return

string The filtered context value for wp_get_attachment_images when doing shortcodes.

Source

function _filter_do_shortcode_context() {
	return 'do_shortcode';
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.