strip_shortcodes_tagnames

Filters the list of shortcode tags to remove from the content.

Description

apply_filters( 'strip_shortcodes_tagnames', (array) $tags_to_remove, (string) $content ); 

Parameters (2)

0. $tags_to_remove (array)
Array of shortcode tags to remove.
1. $content (string)
Content shortcodes are being removed from.

Usage

To run the hook, copy the example below.
  1. $tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content ); 
  2.  
  3. if ( !empty( $tags_to_remove ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the strip_shortcodes_tagnames callback 
  2. function filter_strip_shortcodes_tagnames( $tags_to_remove, $content ) { 
  3. // make filter magic happen here... 
  4. return $tags_to_remove
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'strip_shortcodes_tagnames', 'filter_strip_shortcodes_tagnames', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'strip_shortcodes_tagnames', 'filter_strip_shortcodes_tagnames', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/shortcodes.php  
  1. $tags_to_remove = apply_filters( 'strip_shortcodes_tagnames', $tags_to_remove, $content );