Making WordPress.org


Ignore:
Timestamp:
02/08/2017 08:21:45 PM (7 years ago)
Author:
coffee2code
Message:

Support Forums: Omit forum link from breadcrumbs for plugin/theme support forums and reviews

Their general forums are hidden from listings and no longer meant to be directly linked.

Fixes #2486.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php

    r4331 r4894  
    447447        }
    448448
    449         $r[1] = '<a href="' . esc_url( bbp_get_forum_permalink( $this->forum_id() ) ) . '" class="bbp-breadcrumb-forum">' . esc_html( bbp_get_forum_title( $this->forum_id() ) ) . '</a>';
    450         $r[2] = esc_html( $this->title() );
     449        $r[1] = esc_html( $this->title() );
    451450        if ( in_array( $view, array( 'reviews', 'active' ) ) ) {
    452             $r[2] = '<a href="' . esc_url( bbp_get_view_url( $this->compat() ) ) . '" class="bbp-breadcrumb-forum">' . esc_html( $this->title() ) . '</a>';
     451            // Prefix link to plugin/theme support or review forum with context.
     452            if ( 'plugin' === $this->compat() ) {
     453                /* translators: %s: link to plugin support or review forum */
     454                $parent_breadcrumb = __( 'Plugin: %s', 'wporg-forums' );
     455            } else {
     456                /* translators: %s: link to theme support or review forum */
     457                $parent_breadcrumb = __( 'Theme: %s', 'wporg-forums' );
     458            }
     459            $r[1] = sprintf( $parent_breadcrumb, sprintf(
     460                '<a href="%s" class="bbp-breadcrumb-forum">%s</a>',
     461                esc_url( bbp_get_view_url( $this->compat() ) ),
     462                esc_html( $this->title() )
     463            ) );
    453464            if ( 'reviews' == $view ) {
    454                 $r[3] = __( 'Reviews', 'wporg-forums' );
     465                $r[2] = __( 'Reviews', 'wporg-forums' );
    455466            } else {
    456                 $r[3] = __( 'Active Topics', 'wporg-forums' );
     467                $r[2] = __( 'Active Topics', 'wporg-forums' );
    457468            }
    458469        }
Note: See TracChangeset for help on using the changeset viewer.