Make WordPress Core

Ticket #12061: 12061.2.diff

File 12061.2.diff, 734 bytes (added by DrewAPicture, 8 years ago)

'unautop_shortcodes' + hook docs

  • src/wp-includes/formatting.php

     
    476476                return $pee;
    477477        }
    478478
    479         $tagregexp = join( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) );
     479        /**
     480         * Filter the list of shortcodes to run through the 'unautop' routine.
     481         *
     482         * @since 4.1.0
     483         *
     484         * @param array $shortcode_tags Shortcode tags to run through the 'unautop' routine.
     485         */
     486        $shortcode_tags = apply_filters( 'unautop_shortcodes', $shortcode_tags );
     487
     488        $tagregexp = join( '|', array_map( 'preg_quote', $shortcode_tags ) );
    480489        $spaces = wp_spaces_regexp();
    481490
    482491        $pattern =