do_shortcode_tag
Filters the output created by a shortcode callback.
Usage
add_filter( 'do_shortcode_tag', 'wp_kama_do_shortcode_tag_filter', 10, 4 ); /** * Function for `do_shortcode_tag` filter-hook. * * @param string $output Shortcode output. * @param string $tag Shortcode name. * @param array $attr Shortcode attributes array, can be empty if the original arguments string cannot be parsed. * @param array $m Regular expression match array. * * @return string */ function wp_kama_do_shortcode_tag_filter( $output, $tag, $attr, $m ){ // filter... return $output; }
- $output(string)
- Shortcode output.
- $tag(string)
- Shortcode name.
- $attr(array)
- Shortcode attributes array, can be empty if the original arguments string cannot be parsed.
- $m(array)
- Regular expression match array.
Changelog
Since 4.7.0 | Introduced. |
Since 6.5.0 | The $attr parameter is always an array. |
Where the hook is called
do_shortcode_tag
wp-includes/shortcodes.php 447
return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );