Making WordPress.org

Changeset 4894


Ignore:
Timestamp:
02/08/2017 08:21:45 PM (8 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.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
Files:
2 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        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-support-compat.php

    r4612 r4894  
    463463        }
    464464
    465         $link = sprintf(
     465        // Prefix link to plugin/theme support or review forum with context.
     466        if ( 'plugin' === $type ) {
     467            /* translators: %s: link to plugin support or review forum */
     468            $parent_breadcrumb = __( 'Plugin: %s', 'wporg-forums' );
     469        } else {
     470            /* translators: %s: link to theme support or review forum */
     471            $parent_breadcrumb = __( 'Theme: %s', 'wporg-forums' );
     472        }
     473        $link = sprintf( $parent_breadcrumb, sprintf(
    466474            '<a href="%s" class="bbp-breadcrumb-forum">%s</a>',
    467475            esc_url( $url ),
    468476            esc_html( $obj->post_title )
    469         );
     477        ) );
    470478
    471479        // Insert link before topic title.
    472         array_splice( $r, 2, 0, $link );
     480        array_splice( $r, 1, 1, $link );
    473481
    474482        return $r;
Note: See TracChangeset for help on using the changeset viewer.