do_shortcode_tag
Filter HookDescription
Filters the output created by a shortcode callback.Hook Information
File Location |
wp-includes/shortcodes.php
View on GitHub
|
Hook Type | Filter |
Line Number | 447 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$output
|
Shortcode output. |
string
|
$tag
|
Shortcode name. |
array
|
$attr
|
Shortcode attributes array, can be empty if the original arguments string cannot be parsed. |
array
|
$m
|
Regular expression match array. |
Usage Examples
Basic Usage
<?php
// Hook into do_shortcode_tag
add_filter('do_shortcode_tag', 'my_custom_filter', 10, 4);
function my_custom_filter($output, $tag, $attr, $m) {
// Your custom filtering logic here
return $output;
}
Source Code Context
wp-includes/shortcodes.php:447
- How this hook is used in WordPress core
<?php
442 * @param string $output Shortcode output.
443 * @param string $tag Shortcode name.
444 * @param array $attr Shortcode attributes array, can be empty if the original arguments string cannot be parsed.
445 * @param array $m Regular expression match array.
446 */
447 return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );
448 }
449
450 /**
451 * Searches only inside HTML elements for shortcodes and process them.
452 *
PHP Documentation
<?php
/**
* Filters the output created by a shortcode callback.
*
* @since 4.7.0
* @since 6.5.0 The `$attr` parameter is always an array.
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/shortcodes.php
Related Hooks
Related hooks will be displayed here in future updates.