Skip to:
Content

BuddyPress.org

Changeset 1520


Ignore:
Timestamp:
06/05/2009 09:58:24 PM (17 years ago)
Author:
apeatling
Message:

Making sure there is always a valid max fallback on widgets.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-widgets.php

    r1488 r1520  
    2828               
    2929        <?php
    30         if ( empty( $options['max_items'] ) ) {
     30        if ( !$options['max_items'] || empty( $options['max_items'] ) )
    3131                $options['max_items'] = 20;
    32         }
    3332        ?>
    3433       
  • trunk/bp-blogs/bp-blogs-widgets.php

    r1473 r1520  
    2121    extract($args);
    2222        $options = get_blog_option( $current_blog->blog_id, 'bp_blogs_widget_recent_posts' );
     23       
     24        if ( empty( $options['max_posts'] ) || !$options['max_posts'] )
     25                $options['max_posts'] = 5;
    2326?>
    2427        <?php echo $before_widget; ?>
     
    2730                . $after_title; ?>
    2831
    29                 <?php $posts = bp_blogs_get_latest_posts( null, $options['max_posts'] ) ?>
    30                 <?php $counter = 0; ?>
     32        <?php $posts = bp_blogs_get_latest_posts( null, $options['max_posts'] ) ?>
     33        <?php $counter = 0; ?>
    3134               
    3235        <?php if ( $posts ) : ?>
  • trunk/bp-core/bp-core-widgets.php

    r1518 r1520  
    8989                . $after_title; ?>
    9090       
    91         <?php
     91        <?php
     92        if ( empty( $options['max_members'] ) || !$options['max_members'] )
     93                $options['max_members'] = 5;
     94               
    9295        if ( !$users = wp_cache_get( 'newest_users', 'bp' ) ) {
    9396                $users = BP_Core_User::get_newest_users( $options['max_members'] );
     
    170173                . $after_title; ?>
    171174
    172         <?php
     175        <?php
     176        if ( empty( $options['max_members'] ) || !$options['max_members'] )
     177                $options['max_members'] = 5;
     178               
    173179        if ( !$users = wp_cache_get( 'online_users', 'bp' ) ) {
    174180                $users = BP_Core_User::get_online_users( $options['max_members'] );
  • trunk/bp-groups/bp-groups-widgets.php

    r1505 r1520  
    3232
    3333        <?php
     34        if ( empty( $options['max_groups'] ) || !$options['max_groups'] )
     35                $options['max_groups'] = 5;
     36               
    3437        if ( !$groups = wp_cache_get( 'popular_groups', 'bp' ) ) {
    3538                $groups = groups_get_popular( $options['max_groups'], 1 );
Note: See TracChangeset for help on using the changeset viewer.