_filter_do_shortcode_context()WP 6.3.0

Filter the wp_get_attachment_image_context during shortcode rendering.

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.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Returns

String. The filtered context value for wp_get_attachment_images when doing shortcodes.

Usage

_filter_do_shortcode_context();

Changelog

Since 6.3.0 Introduced.

_filter_do_shortcode_context() code WP 7.0

function _filter_do_shortcode_context() {
	return 'do_shortcode';
}