Filter hook 'strip_shortcodes_tagnames'

in WP Core File wp-includes/shortcodes.php at line 730

View Source

strip_shortcodes_tagnames

Filter Hook
Description
Filters the list of shortcode tags to remove from the content.

Hook Information

File Location wp-includes/shortcodes.php View on GitHub
Hook Type Filter
Line Number 730

Hook Parameters

Type Name Description
array $tags_to_remove Array of shortcode tags to remove.
string $content Content shortcodes are being removed from.

Usage Examples

Basic Usage
<?php
// Hook into strip_shortcodes_tagnames
add_filter('strip_shortcodes_tagnames', 'my_custom_filter', 10, 2);

function my_custom_filter($tags_to_remove, $content) {
    // Your custom filtering logic here
    return $tags_to_remove;
}

Source Code Context

wp-includes/shortcodes.php:730 - How this hook is used in WordPress core
<?php
 725  	 * @since 4.7.0
 726  	 *
 727  	 * @param array  $tags_to_remove Array of shortcode tags to remove.
 728  	 * @param string $content        Content shortcodes are being removed from.
 729  	 */
 730  	$tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content );
 731  
 732  	$tagnames = array_intersect( $tags_to_remove, $matches[1] );
 733  
 734  	if ( empty( $tagnames ) ) {
 735  		return $content;

PHP Documentation

<?php
/**
	 * Filters the list of shortcode tags to remove from the content.
	 *
	 * @since 4.7.0
	 *
	 * @param array  $tags_to_remove Array of shortcode tags to remove.
	 * @param string $content        Content shortcodes are being removed from.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/shortcodes.php
Related Hooks

Related hooks will be displayed here in future updates.