Changeset 15532
- Timestamp:
- 11/10/2026 08:44:28 PM (6 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/functions.php
r15484 r15532 408 408 $args['home_text'] = __( 'Forums', 'wporg-forums' ); 409 409 410 // HelpHub pages aren't part of the forums. 411 if ( is_singular( array( 'helphub_article', 'helphub_version' ) ) || is_category() ) { 412 $args['home_text'] = esc_html__( 'Support', 'wporg-forums' ); 413 } 414 410 415 // Forum root 411 416 $args['include_root'] = false; … … 416 421 $args['current_after'] = '</span>'; 417 422 423 // bbPress would use the title of the first post in the archive. 424 if ( is_category() ) { 425 $args['current_text'] = esc_html( single_cat_title( '', false ) ); 426 } 427 418 428 return $args; 419 429 } … … 423 433 'bbp_breadcrumbs', 424 434 /** 425 * Filters the breadcrumbs to replace the home URL with the forums page. 435 * Filters the breadcrumbs to replace the home URL with the forums page, 436 * and to add the category to HelpHub articles. 426 437 */ 427 438 function( $crumbs ) { 439 if ( is_singular( 'helphub_article' ) ) { 440 $categories = get_the_category( get_queried_object_id() ); 441 442 if ( $categories ) { 443 $category_crumb = sprintf( 444 '<a href="%1$s" class="bbp-breadcrumb-category">%2$s</a>', 445 esc_url( get_category_link( $categories[0] ) ), 446 esc_html( $categories[0]->name ) 447 ); 448 array_splice( $crumbs, 1, 0, $category_crumb ); 449 } 450 } 451 452 if ( is_singular( array( 'helphub_article', 'helphub_version' ) ) || is_category() ) { 453 return $crumbs; 454 } 455 428 456 foreach ( $crumbs as $i => $link ) { 429 457 if ( str_contains( $link, 'bbp-breadcrumb-home' ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)