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-groups/classes/class-bp-groups-widget.php

    r10613 r10793  
    2525    public function __construct() {
    2626        $widget_ops = array(
    27             'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ),
    28             'classname' => 'widget_bp_groups_widget buddypress widget',
     27            'description'                 => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ),
     28            'classname'                   => 'widget_bp_groups_widget buddypress widget',
     29            'customize_selective_refresh' => true,
    2930        );
    3031        parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops );
    3132
    32         if ( is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) {
     33        if ( is_customize_preview() || is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) {
    3334            $min = bp_core_get_minified_asset_suffix();
    3435            wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() );
Note: See TracChangeset for help on using the changeset viewer.