WordPress.org

Make WordPress Core

Ticket #11249: autop.diff

File autop.diff, 778 bytes (added by matt, 8 years ago)
  • formatting.php

     
    216216       if (strpos($pee, '<pre') !== false)
    217217               $pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee );
    218218       $pee = preg_replace( "|\n</p>$|", '</p>', $pee );
    219        $pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone
     219       if ( function_exists( 'get_shortcode_regex' ) )
     220               $pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone
    220221
    221222       return $pee;
    222223}