[wp-trac] [WordPress Trac] #16494: Remove "no conflict" mode from bundled jquery

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 14 03:54:43 UTC 2012


#16494: Remove "no conflict" mode from bundled jquery
--------------------------------+------------------------------
 Reporter:  lloydbudd           |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  low                 |   Milestone:  Awaiting Review
Component:  External Libraries  |     Version:  3.1
 Severity:  minor               |  Resolution:
 Keywords:  close               |
--------------------------------+------------------------------

Comment (by WraithKenny):

 Perhaps a function that'd do:

 {{{
 <script>var $bak = $; $ = jQuery;</script>
 }}}

 before the desired jQuery plugin script, then after it:

 {{{
 <script>$ = $bak;</script>
 }}}

 used as such:
 {{{
 wp_jquery_conflict_resolution( 'dollar-dependant-plugin' );
 }}}

 Alternatively, just register jQuery's source as 'jquery-conflict' and
 register the `jQuery.noConflict();` bit as 'jquery' but that depends on
 'jquery-conflict'
 {{{
 wp_register_script( 'jquery-conflict', 'jquery.js', ... );
 wp_register_script( 'jquery', 'jquery-noconflict.js', array('jquery-
 conflict'), ... );
 }}}
 this way both are always loaded when 'jquery' is enqueued and it can be
 concatenated.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16494#comment:37>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list