strip_shortcode_tag

Strips a shortcode tag based on RegEx matches against post content.

Description

(string|false) strip_shortcode_tag( (array) $m ); 

Returns (string|false)

The content stripped of the tag, otherwise false.

Parameters (1)

0. $m (array)
RegEx matches against post content.

Usage

  1. if ( !function_exists( 'strip_shortcode_tag' ) ) { 
  2. require_once ABSPATH . WPINC . '/shortcodes.php'; 
  3.  
  4. // RegEx matches against post content. 
  5. $m = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = strip_shortcode_tag($m); 
  9.  

Defined (1)

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

/wp-includes/shortcodes.php  
  1. function strip_shortcode_tag( $m ) { 
  2. // allow [[foo]] syntax for escaping a tag 
  3. if ( $m[1] == '[' && $m[6] == ']' ) { 
  4. return substr($m[0], 1, -1); 
  5.  
  6. return $m[1] . $m[6];