[wp-trac] [WordPress Trac] #14488: wp_enqueue_script in_footer doesn't work on WP known scripts
WordPress Trac
noreply at wordpress.org
Wed Feb 4 22:59:01 UTC 2015
#14488: wp_enqueue_script in_footer doesn't work on WP known scripts
---------------------------+-----------------------
Reporter: mcr2582 | Owner: sorich87
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.2
Component: Script Loader | Version: 3.0.1
Severity: minor | Resolution: fixed
Keywords: has-patch | Focuses:
---------------------------+-----------------------
Comment (by sc0ttkclark):
This introduces a change which now throws notices when $handle is an
array. Of course, the wp_enqueue_script and wp_enqueue_style functions are
not documented to accept arrays, they may be (and have been) used as such
-- even by at least one of the most popular plugins on wordpress.org.
Up until earlier this month in the trunk commit for 4.2 [31028], the
unintended consequences of calling the following code were that multiple
handles could be enqueued at once. Documentation in code and in codex says
it's a string, but it threw no notices or errors, or doing it wrong's.
{{{
wp_enqueue_script( array( 'jquery', 'etc', 'etc2' ) );
}}}
With that, should a new ticket be opened up to add documented support for
array as $handle in wp_enqueue_script and wp_enqueue_style, or would this
ticket need to have a new patch applied which at minimal removes the
notice that's introduced in 4.2 for undocumented use of arrays?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/14488#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list