[wp-trac] [WordPress Trac] #32445: `is_callable()` should be checked in `do_shortcode_tag()`, not `add_shortcode()`
WordPress Trac
noreply at wordpress.org
Sun Jun 14 19:06:24 UTC 2015
#32445: `is_callable()` should be checked in `do_shortcode_tag()`, not
`add_shortcode()`
----------------------------+------------------
Reporter: wonderboymusic | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.3
Component: Shortcodes | Version: 2.6
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
----------------------------+------------------
Changes (by nacin):
* keywords: has-patch needs-refresh => has-patch
Comment:
Yeah, moving `add_shortcode()` calls to default-filters.php will break
things in weird situations, like including a few random files outside of
WordPress. I'm not saying we should ever support that (and I often argue,
such as in the `SHORTINIT` situations, that we should not), but in this
case, the only functions called in default-filters.php are `add_action()`
and `add_filter()` (and `is_admin()`). It should stay that way.
I'd agree with moving them out of here, but it should probably go to some
kind of `shortcodes_init()` like widgets and other things. Moving them too
late could break plugins that currently remove them pretty early, however.
Kind of stuck here.
I do like the callback change here, though.
(Random thought, if anyone wants to have some fun, we should rewrite the
API to use hooks under the hood, and ditch `$shortcode_tags`. And then
break everyone reaching directly into `$shortcode_tags`.)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32445#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list