Making WordPress.org

Changeset 12369


Ignore:
Timestamp:
01/26/2023 04:23:09 PM (2 years ago)
Author:
ryelle
Message:

Support Forums: Update links in breadcrumb and header.

Update the home links in breadcrumbs and header bar to link to the forums landing page. Also updates the Documentation link to the new w.org/documentation URL.

Props zoonini.
Fixes #6704.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r12321 r12369  
    175175}
    176176add_filter( 'bbp_before_get_breadcrumb_parse_args', 'wporg_support_breadcrumb' );
     177
     178add_filter(
     179    'bbp_breadcrumbs',
     180    /**
     181     * Filters the breadcrumbs to replace the home URL with the forums page.
     182     */
     183    function( $crumbs ) {
     184        foreach ( $crumbs as $i => $link ) {
     185            if ( str_contains( $link, 'bbp-breadcrumb-home' ) ) {
     186                $crumbs[ $i ] = str_replace( home_url(), home_url( '/forums/' ), $link );
     187            }
     188        }
     189        return $crumbs;
     190    },
     191    10,
     192    2
     193);
    177194
    178195/**
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/header.php

    r11496 r12369  
    1515    /* translators: relative link to the forums home page */
    1616    _x( '/forums/', 'header menu', 'wporg-forums' )                                     => _x( 'Forums', 'header menu', 'wporg-forums' ),
    17     _x( 'https://wordpress.org/support/guidelines/', 'header menu', 'wporg-forums' )     => _x( 'Guidelines', 'header menu', 'wporg-forums' ),
    18     _x( 'https://wordpress.org/support/', 'header menu', 'wporg-forums' )               => _x( 'Documentation', 'header menu', 'wporg-forums' ),
     17    _x( 'https://wordpress.org/support/guidelines/', 'header menu', 'wporg-forums' )    => _x( 'Guidelines', 'header menu', 'wporg-forums' ),
     18    _x( 'https://wordpress.org/documentation/', 'header menu', 'wporg-forums' )         => _x( 'Documentation', 'header menu', 'wporg-forums' ),
    1919    _x( 'https://make.wordpress.org/support/handbook/', 'header menu', 'wporg-forums' ) => _x( 'Get Involved', 'header menu', 'wporg-forums' ),
    2020);
     
    3333            <div class="site-branding">
    3434                <?php if ( is_front_page() ) : ?>
    35                     <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php _ex( 'WordPress Support', 'Site title', 'wporg-forums' ); ?></a></h1>
     35                    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/forums/' ) ); ?>" rel="home"><?php _ex( 'WordPress Support', 'Site title', 'wporg-forums' ); ?></a></h1>
    3636
    3737                    <p class="site-description">
     
    4343                    <?php get_search_form(); ?>
    4444                <?php else : ?>
    45                     <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php _ex( 'Support', 'Site title', 'wporg-forums' ); ?></a></p>
     45                    <p class="site-title"><a href="<?php echo esc_url( home_url( '/forums/' ) ); ?>" rel="home"><?php _ex( 'Support', 'Site title', 'wporg-forums' ); ?></a></p>
    4646
    4747                    <nav id="site-navigation" class="main-navigation" role="navigation">
Note: See TracChangeset for help on using the changeset viewer.