Skip to:
Content

BuddyPress.org


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 ) : ?>
Note: See TracChangeset for help on using the changeset viewer.