Changeset 10809
- Timestamp:
- 05/25/2016 05:36:41 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/classes/class-bp-core-friends-widget.php
r10793 r10809 31 31 parent::__construct( false, $name = _x( '(BuddyPress) Friends', 'widget name', 'buddypress' ), $widget_ops ); 32 32 33 if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) { 34 $min = bp_core_get_minified_asset_suffix(); 35 wp_enqueue_script( 'bp_core_widget_friends-js', buddypress()->plugin_url . "bp-friends/js/widget-friends{$min}.js", array( 'jquery' ), bp_get_version() ); 33 if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) ) { 34 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 36 35 } 37 36 } 37 38 /** 39 * Enqueue scripts. 40 * 41 * @since 2.6.0 42 */ 43 public function enqueue_scripts() { 44 $min = bp_core_get_minified_asset_suffix(); 45 wp_enqueue_script( 'bp_core_widget_friends-js', buddypress()->plugin_url . "bp-friends/js/widget-friends{$min}.js", array( 'jquery' ), bp_get_version() ); 38 46 } 39 47 -
trunk/src/bp-groups/classes/class-bp-groups-widget.php
r10793 r10809 31 31 parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops ); 32 32 33 if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) { 34 $min = bp_core_get_minified_asset_suffix(); 35 wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() ); 33 if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) ) { 34 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 36 35 } 36 } 37 38 /** 39 * Enqueue scripts. 40 * 41 * @since 2.6.0 42 */ 43 public function enqueue_scripts() { 44 $min = bp_core_get_minified_asset_suffix(); 45 wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() ); 37 46 } 38 47 -
trunk/src/bp-members/classes/class-bp-core-members-widget.php
r10793 r10809 36 36 ) ); 37 37 38 // Maybe enqueue JS for widget. 39 if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) { 40 wp_enqueue_script( 'bp-widget-members' ); 38 if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) ) { 39 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 41 40 } 41 } 42 43 /** 44 * Enqueue scripts. 45 * 46 * @since 2.6.0 47 */ 48 public function enqueue_scripts() { 49 wp_enqueue_script( 'bp-widget-members' ); 42 50 } 43 51
Note: See TracChangeset
for help on using the changeset viewer.