#8962 closed defect (bug) (duplicate)
get_shortcode_regex probrem
Reported by: | smilkobuta | Owned by: | |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | normal | Version: | 2.7 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Long articles is not displayed because of get_shortcode_regex function.
this function is invoked by wpautop function, and maybe preg_replace can't perform a regular expression which generated in get_shortcode_regex.
This is wpauto code(there is no probrem).
$pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone
Here is modified code.
function get_shortcode_regex() { global $shortcode_tags; $tagnames = array_keys($shortcode_tags); $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); // return '\[('.$tagregexp.')\b(.*?)(?:(\/)?\](?:(.+?)\[\/\1\])?'; return '\[('.$tagregexp.')\b([^\]]*?)(\/)?\](?:(.+?)\[\/\1\])?'; }
This modification was written by following blog.
http://www.brusdeylins.info/wordpress/probleme-mit-shortcodes/
Change History (3)
Note: See
TracTickets for help on using
tickets.
See #8553 and related.