Skip to:
Content

Changeset 10384


Ignore:
Timestamp:
11/28/15 03:32:24 (2 years ago)
Author:
boonebgorges
Message:

Make sure that max_groups is always defined in group widget.

This prevents a notice from being shown when the widget is added in the
Customizer.

Props slaFFik.
See #6754.
Fixes #6747.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-widgets.php

    r10373 r10384  
    100100        echo $before_title . $title . $after_title; 
    101101 
     102        $max_groups = ! empty( $instance['max_groups'] ) ? (int) $instance['max_groups'] : 5; 
     103 
    102104        $group_args = array( 
    103105            'user_id'         => $user_id, 
    104106            'type'            => $instance['group_default'], 
    105             'per_page'        => $instance['max_groups'], 
    106             'max'             => $instance['max_groups'], 
     107            'per_page'        => $max_groups, 
     108            'max'             => $max_groups, 
    107109        ); 
    108110 
     
    145147            </ul> 
    146148            <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?> 
    147             <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $instance['max_groups'] ); ?>" /> 
     149            <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $max_groups ); ?>" /> 
    148150 
    149151        <?php else: ?> 
Note: See TracChangeset for help on using the changeset viewer.