[wp-trac] [WordPress Trac] #50683: Parse content for shortcodes instead of using regex

WordPress Trac noreply at wordpress.org
Tue Oct 20 21:25:31 UTC 2020


#50683: Parse content for shortcodes instead of using regex
-------------------------------------------------+-------------------------
 Reporter:  cfinke                               |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  5.7
Component:  Shortcodes                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests early       |     Focuses:
  needs-testing                                  |
-------------------------------------------------+-------------------------

Comment (by cfinke):

 Since the patch eliminates the use of `get_shortcode_regex()` in
 `do_shortcode()`, other places in the code that call
 `get_shortcode_regex()` could potentially be updated to use
 `WP_Shortcode_Parser` as well:

 * `has_shortcode()`
 * `strip_shortcodes()`
 * `do_shortcodes_in_html_tags()`
 * `get_post_galleries()`
 * `wp_ajax_parse_embed()`

 This wouldn't have to happen simultaneously with switching
 `do_shortcode()` to use `WP_Shortcode_Parser`, but it might not be a bad
 idea so that everything that parses shortcodes does it consistently.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50683#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list