Changeset 5564 for trunk/bp-groups/bp-groups-widgets.php
- Timestamp:
- 12/17/2011 02:24:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-widgets.php
r5199 r5564 42 42 43 43 echo $before_widget; 44 45 $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title']; 46 44 47 echo $before_title 45 . $ instance['title']48 . $title 46 49 . $after_title; ?> 47 50 … … 96 99 function update( $new_instance, $old_instance ) { 97 100 $instance = $old_instance; 98 $instance['title'] = strip_tags( $new_instance['title'] ); 99 $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); 101 102 $instance['title'] = strip_tags( $new_instance['title'] ); 103 $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); 100 104 $instance['group_default'] = strip_tags( $new_instance['group_default'] ); 105 $instance['link_title'] = (bool)$new_instance['link_title']; 101 106 102 107 return $instance; … … 107 112 'title' => __( 'Groups', 'buddypress' ), 108 113 'max_groups' => 5, 109 'group_default' => 'active' 114 'group_default' => 'active', 115 'link_title' => false 110 116 ); 111 117 $instance = wp_parse_args( (array) $instance, $defaults ); 112 118 113 $title = strip_tags( $instance['title'] );114 $max_groups = strip_tags( $instance['max_groups'] );119 $title = strip_tags( $instance['title'] ); 120 $max_groups = strip_tags( $instance['max_groups'] ); 115 121 $group_default = strip_tags( $instance['group_default'] ); 122 $link_title = (bool)$instance['link_title']; 116 123 ?> 117 124 118 125 <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> 126 127 <p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Groups directory', 'buddypress' ) ?></label></p> 119 128 120 129 <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.