Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/19/2016 09:21:46 PM (5 years ago)
Author:
r-a-y
Message:

Widgets: Add support for WP Customizer's selective refresh.

This functionality is available as of WordPress 4.5.0.

For more details, view the WP development post:
https://make.wordpress.org/core/2016/03/22/implementing-selective-refresh-support-for-widgets/

Props lakrisgubben.
Fixes #7030.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-core-members-widget.php

    r10711 r10793  
    3131        // Call WP_Widget constructor.
    3232        parent::__construct( false, $name, array(
    33             'description' => $description,
    34             'classname'   => 'widget_bp_core_members_widget buddypress widget',
     33            'description'                 => $description,
     34            'classname'                   => 'widget_bp_core_members_widget buddypress widget',
     35            'customize_selective_refresh' => true,
    3536        ) );
    3637
    3738        // Maybe enqueue JS for widget.
    38         if ( is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) {
     39        if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) {
    3940            wp_enqueue_script( 'bp-widget-members' );
    4041        }
Note: See TracChangeset for help on using the changeset viewer.