Ticket #769: template-functions.php.diff
| File template-functions.php.diff, 2.0 KB (added by rmccue, 4 years ago) |
|---|
-
template-functions.php
284 284 return 'stats-page' == bb_get_location(); 285 285 } 286 286 287 function bb_title( ) {288 echo apply_filters( 'bb_title', bb_get_title( ) );287 function bb_title( $args = '' ) { 288 echo apply_filters( 'bb_title', bb_get_title( $args ) ); 289 289 } 290 290 291 function bb_get_title() { 291 function bb_get_title( $args = '' ) { 292 $defaults = array( 'separator' => ' « ', 'title' => 'first', 'front' => '' ); 293 $args = wp_parse_args( $args, $defaults ); 292 294 $title = ''; 293 if ( is_topic() ) 294 $title = get_topic_title(). ' « '; 295 if ( 'last' == $args['title'] ) 296 $title .= bb_get_option( 'name' ) . ( ( !is_front() || !empty( $args['front'] ) ) ? $args['separator'] : '' ); 297 if ( is_front() && !empty( $args['front'] ) ) 298 $title .= $args['front']; 299 elseif ( is_topic() ) 300 $title .= get_topic_title(); 295 301 elseif ( is_forum() ) 296 $title = get_forum_name() . ' « '; 297 elseif ( is_bb_tags() ) 298 $title = ( is_bb_tag() ? wp_specialchars( bb_get_tag_name() ) . ' « ' : '' ) . __('Tags') . ' « '; 302 $title .= get_forum_name(); 303 elseif ( is_bb_tags() ) { 304 if ( 'last' == $args['title'] ) 305 $title .= __('Tags') . $args['separator']; 306 $title .= ( is_bb_tag() ? wp_specialchars( bb_get_tag_name() ) : '' ); 307 if ( 'last' != $args['title'] ) 308 $title .= $args['separator'] . __('Tags'); 309 } 299 310 elseif ( is_bb_profile() ) 300 $title = get_user_name() . ' « ';311 $title .= get_user_name(); 301 312 elseif ( is_view() ) 302 $title = get_view_name() . ' « ';313 $title .= get_view_name(); 303 314 if ( $st = bb_get_option( 'static_title' ) ) 304 $title = $st; 305 $title .= bb_get_option( 'name' ); 315 $title .= $st; 316 if ( 'first' == $args['title'] ) 317 $title .= ( ( !is_front() || !empty( $args['front'] ) ) ? $args['separator'] : '' ) . bb_get_option( 'name' ); 306 318 return apply_filters( 'bb_get_title', $title ); 307 319 } 308 320