Changeset 2168 for trunk/bp-blogs/bp-blogs-widgets.php
- Timestamp:
- 12/14/2009 03:24:05 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-blogs/bp-blogs-widgets.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-widgets.php
r1926 r2168 5 5 add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");') ); 6 6 } 7 add_action( ' plugins_loaded', 'bp_blogs_register_widgets' );7 add_action( 'template_redirect', 'bp_blogs_register_widgets' ); 8 8 9 9 class BP_Blogs_Recent_Posts_Widget extends WP_Widget { … … 14 14 function widget($args, $instance) { 15 15 global $bp; 16 16 17 17 extract( $args ); 18 18 19 19 echo $before_widget; 20 20 echo $before_title 21 . $widget_name 21 . $widget_name 22 22 . $after_title; ?> 23 23 24 24 <?php 25 25 if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] ) 26 26 $instance['max_posts'] = 10; ?> 27 27 28 28 <?php $posts = bp_blogs_get_latest_posts( null, $instance['max_posts'] ) ?> 29 29 <?php $counter = 0; ?> 30 30 31 31 <?php if ( $posts ) : ?> 32 32 <div class="item-options" id="recent-posts-options"> … … 48 48 </div> 49 49 </li> 50 <?php $counter++; ?> 50 <?php $counter++; ?> 51 51 <?php endforeach; ?> 52 52 </ul> … … 56 56 </div> 57 57 <?php endif; ?> 58 58 59 59 <?php echo $after_widget; ?> 60 60 <?php
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)