]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/shortcodes.php
Wordpress 4.6
[autoinstalls/wordpress.git] / wp-includes / shortcodes.php
index ab8c43337f9b3b1371ac59b0ab42d13ca620a278..e27670844923d1dce7df034d943af75f92228598 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- * WordPress API for creating bbcode like tags or what WordPress calls
- * "shortcodes." The tag and attribute parsing or regular expression code is
+ * WordPress API for creating bbcode-like tags or what WordPress calls
+ * "shortcodes". The tag and attribute parsing or regular expression code is
  * based on the Textpattern tag parser.
  *
  * A few examples are below:
@@ -96,8 +96,8 @@ function add_shortcode($tag, $func) {
        }
 
        if ( 0 !== preg_match( '@[<>&/\[\]\x00-\x20=]@', $tag ) ) {
-               /* translators: %s: shortcode name */
-               $message = sprintf( __( 'Invalid shortcode name: %s. Do not use spaces or reserved characters: & / < > [ ]' ), $tag );
+               /* translators: 1: shortcode name, 2: space separated list of reserved characters */
+               $message = sprintf( __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ), $tag, '& / < > [ ] =' );
                _doing_it_wrong( __FUNCTION__, $message, '4.4.0' );
                return;
        }
@@ -537,7 +537,7 @@ function shortcode_atts( $pairs, $atts, $shortcode = '' ) {
                        $out[$name] = $default;
        }
        /**
-        * Filter a shortcode's default attributes.
+        * Filters a shortcode's default attributes.
         *
         * If the third parameter of the shortcode_atts() function is present then this filter is available.
         * The third parameter, $shortcode, is the name of the shortcode.
@@ -597,9 +597,12 @@ function strip_shortcodes( $content ) {
 }
 
 /**
+ * Strips a shortcode tag based on RegEx matches against post content.
  *
- * @param array $m
- * @return string|false
+ * @since 3.3.0
+ *
+ * @param array $m RegEx matches against post content.
+ * @return string|false The content stripped of the tag, otherwise false.
  */
 function strip_shortcode_tag( $m ) {
        // allow [[foo]] syntax for escaping a tag