Changeset 3402 for trunk/bp-groups/bp-groups-widgets.php
- Timestamp:
- 11/12/2010 09:38:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-widgets.php
r3336 r3402 11 11 class BP_Groups_Widget extends WP_Widget { 12 12 function bp_groups_widget() { 13 parent::WP_Widget( false, $name = __( 'Groups', 'buddypress' ) ); 13 $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ) ); 14 parent::WP_Widget( false, $name = __( 'Groups', 'buddypress' ), $widget_ops ); 14 15 15 16 if ( is_active_widget( false, false, $this->id_base ) ) … … 27 28 echo $before_widget; 28 29 echo $before_title 29 . $ widget_name30 . $instance['title'] 30 31 . $after_title; ?> 31 32 … … 81 82 function update( $new_instance, $old_instance ) { 82 83 $instance = $old_instance; 84 $instance['title'] = strip_tags( $new_instance['title'] ); 83 85 $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); 84 86 $instance['group_default'] = strip_tags( $new_instance['group_default'] ); … … 88 90 89 91 function form( $instance ) { 90 $instance = wp_parse_args( (array) $instance, array( 'max_groups' => 5, 'group_default' => 'active' ) ); 92 $defaults = array( 93 'title' => __( 'Groups', 'buddypress' ), 94 'max_members' => 5, 95 'group_default' => 'active' 96 ); 97 $instance = wp_parse_args( (array) $instance, $defaults ); 98 99 $title = strip_tags( $instance['title'] ); 91 100 $max_groups = strip_tags( $instance['max_groups'] ); 92 101 $group_default = strip_tags( $instance['group_default'] ); 93 102 ?> 103 104 <p><label for="bp-groups-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p> 94 105 95 106 <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p>
Note: See TracChangeset
for help on using the changeset viewer.