Changeset 5564
- Timestamp:
- 12/17/2011 02:24:08 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-widgets.php
r5199 r5564 40 40 41 41 echo $before_widget; 42 43 $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title']; 44 42 45 echo $before_title 43 . $ instance['title']46 . $title 44 47 . $after_title; ?> 45 48 … … 99 102 function update( $new_instance, $old_instance ) { 100 103 $instance = $old_instance; 101 $instance['title'] = strip_tags( $new_instance['title'] ); 102 $instance['max_members'] = strip_tags( $new_instance['max_members'] ); 104 105 $instance['title'] = strip_tags( $new_instance['title'] ); 106 $instance['max_members'] = strip_tags( $new_instance['max_members'] ); 103 107 $instance['member_default'] = strip_tags( $new_instance['member_default'] ); 108 $instance['link_title'] = (bool)$new_instance['link_title']; 104 109 105 110 return $instance; … … 108 113 function form( $instance ) { 109 114 $defaults = array( 110 'title' => __( 'Members', 'buddypress' ), 111 'max_members' => 5, 112 'member_default' => 'active' 115 'title' => __( 'Members', 'buddypress' ), 116 'max_members' => 5, 117 'member_default' => 'active', 118 'link_title' => false 113 119 ); 114 120 $instance = wp_parse_args( (array) $instance, $defaults ); 115 121 116 $title = strip_tags( $instance['title'] );117 $max_members = strip_tags( $instance['max_members'] );122 $title = strip_tags( $instance['title'] ); 123 $max_members = strip_tags( $instance['max_members'] ); 118 124 $member_default = strip_tags( $instance['member_default'] ); 125 $link_title = (bool)$instance['link_title']; 119 126 ?> 120 127 121 128 <p><label for="bp-core-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> 129 130 <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 Members directory', 'buddypress' ) ?></label></p> 122 131 123 132 <p><label for="bp-core-widget-members-max"><?php _e('Max members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p> -
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.