Changeset 7066
- Timestamp:
- 05/15/2013 12:17:45 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-widgets.php
r7065 r7066 28 28 function widget($args, $instance) { 29 29 30 extract( $args);30 $title = ! empty( $instance['title'] ) ? esc_html( $instance['title'] ) : __( 'Recent Networkwide Posts', 'buddypress' ); 31 31 32 $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Recent Networkwide Posts', 'buddypress' ); 32 if ( ! empty( $instance['link_title'] ) ) { 33 $title = '<a href="' . trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . '">' . esc_html( $title ) . '</a>'; 34 } 33 35 34 36 echo $args['before_widget']; 35 echo $args['before_title'] . esc_html( $title ). $args['after_title'];37 echo $args['before_title'] . $title . $args['after_title']; 36 38 37 39 if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] ) … … 79 81 $instance['title'] = strip_tags( $new_instance['title'] ); 80 82 $instance['max_posts'] = strip_tags( $new_instance['max_posts'] ); 83 $instance['link_title'] = (bool) $new_instance['link_title']; 81 84 82 85 return $instance; … … 85 88 function form( $instance ) { 86 89 $instance = wp_parse_args( (array) $instance, array( 87 'title' => __( 'Recent Networkwide Posts', 'buddypress' ), 88 'max_posts' => 10, 90 'title' => __( 'Recent Networkwide Posts', 'buddypress' ), 91 'max_posts' => 10, 92 'link_title' => false, 89 93 ) ); 90 94 91 95 $title = strip_tags( $instance['title'] ); 92 96 $max_posts = strip_tags( $instance['max_posts'] ); 97 $link_title = (bool) $instance['link_title']; 93 98 94 99 ?> 95 100 96 101 <p><label for="<?php echo $this->get_field_id( 'title' ) ?>"><?php _ex( 'Title:', 'Label for the Title field of the Recent Networkwide Posts widget', '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> 102 <p><label for="<?php echo $this->get_field_id( '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 Blogs directory', 'buddypress' ) ?></label></p> 97 103 <p><label for="bp-blogs-widget-posts-max"><?php _e('Max posts to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_posts' ); ?>" name="<?php echo $this->get_field_name( 'max_posts' ); ?>" type="text" value="<?php echo esc_attr( $max_posts ); ?>" style="width: 30%" /></label></p> 98 104 <?php
Note: See TracChangeset
for help on using the changeset viewer.