$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>shortcode - $m in pre_do_shortcode_tag|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

shortcode - $m in pre_do_shortcode_tag

matteradmin10PV0评论

What is the $m parameter of pre_do_shortcode_tag?

var_dump($m) shows for example:

array(7) {
  [0]=>
  string(32) "[gallery id="123" size="medium"]"
  [1]=>
  string(0) ""
  [2]=>
  string(7) "gallery"
  [3]=>
  string(23) " id="123" size="medium""
  [4]=>
  string(0) ""
  [5]=>
  string(0) ""
  [6]=>
  string(0) ""
}

So you can say: It is array of:

  • the whole shortcode command
  • ?
  • the shortcode
  • all options and values prepended with a space character
  • ?
  • ?
  • ?

Where is it documented? Thank you very much.

What is the $m parameter of pre_do_shortcode_tag?

var_dump($m) shows for example:

array(7) {
  [0]=>
  string(32) "[gallery id="123" size="medium"]"
  [1]=>
  string(0) ""
  [2]=>
  string(7) "gallery"
  [3]=>
  string(23) " id="123" size="medium""
  [4]=>
  string(0) ""
  [5]=>
  string(0) ""
  [6]=>
  string(0) ""
}

So you can say: It is array of:

  • the whole shortcode command
  • ?
  • the shortcode
  • all options and values prepended with a space character
  • ?
  • ?
  • ?

Where is it documented? Thank you very much.

Share Improve this question asked Apr 24 at 6:22 pehupehu 235 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

The documentation for $m is available in the function that the pre_do_shortcode_tag filter gets called in, do_shortcode_tag():

/**
 * …
 * @param array $m {
 *     Regular expression match array.
 * 
 *     @type string $0 Entire matched shortcode text.
 *     @type string $1 Optional second opening bracket for escaping shortcodes.
 *     @type string $2 Shortcode name.
 *     @type string $3 Shortcode arguments list.
 *     @type string $4 Optional self closing slash.
 *     @type string $5 Content of a shortcode when it wraps some content.
 *     @type string $6 Optional second closing bracket for escaping shortcodes.
 * }

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far