Changeset 8612
- Timestamp:
- 07/15/2014 07:14:28 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-cssjs.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-cssjs.php
r8559 r8612 11 11 12 12 /** 13 * Register scripts commonly used by BuddyPress plugins and themes.13 * Register scripts commonly used by BuddyPress. 14 14 * 15 15 * @since BuddyPress (2.1.0) 16 16 */ 17 17 function bp_core_register_common_scripts() { 18 19 // Whether or not to use minified versions 20 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.js' : '.min.js'; 21 22 // Get the version for busting caches 23 $ver = bp_get_version(); 24 25 // Get the common core JS URL 26 $url = buddypress()->plugin_url . 'bp-core/js/'; 18 $ext = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.js' : '.min.js'; 19 $url = buddypress()->plugin_url . 'bp-core/js/'; 27 20 28 // Array of common scripts29 21 $scripts = apply_filters( 'bp_core_register_common_scripts', array( 30 'bp-confirm' => 'confirm',31 'bp-widget-members' => 'widget-members',32 'bp-jquery-query' => 'jquery-query',33 'bp-jquery-cookie' => 'jquery-cookie',22 'bp-confirm' => array( 'file' => "{$url}confirm{$ext}", 'dependencies' => array( 'jquery' ) ), 23 'bp-widget-members' => array( 'file' => "{$url}widget-members{$ext}", 'dependencies' => array( 'jquery' ) ), 24 'bp-jquery-query' => array( 'file' => "{$url}jquery-query{$ext}", 'dependencies' => array( 'jquery' ) ), 25 'bp-jquery-cookie' => array( 'file' => "{$url}jquery-cookie{$ext}", 'dependencies' => array( 'jquery' ) ), 34 26 ) ); 35 27 36 // Register scripts commonly used by BuddyPress themes 37 foreach ( $scripts as $id => $file ) { 38 wp_register_script( $id, $url . $file . $min, array( 'jquery' ), $ver ); 28 foreach ( $scripts as $id => $script ) { 29 wp_register_script( $id, $script['file'], $script['dependencies'], bp_get_version() ); 39 30 } 40 31 }
Note: See TracChangeset
for help on using the changeset viewer.