Making WordPress.org


Ignore:
Timestamp:
03/30/2017 12:43:49 AM (8 years ago)
Author:
obenland
Message:

Plugin Directory: Use a SEO-optimized site name for titles.

See #1105.
Fixes #2387.

File:
1 edited

Legend:

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

    r5196 r5203  
    148148
    149149/**
     150 * Append an optimized site name.
     151 *
     152 * @param array $title {
     153 *     The document title parts.
     154 *
     155 *     @type string $title   Title of the viewed page.
     156 *     @type string $page    Optional. Page number if paginated.
     157 *     @type string $tagline Optional. Site description when on home page.
     158 *     @type string $site    Optional. Site title when not on home page.
     159 * }
     160 * @return array Filtered title parts.
     161 */
     162function document_title( $title ) {
     163    if ( is_front_page() ) {
     164        $title['title'] = __( 'WordPress Plugins', 'wporg-plugins' );
     165    } else {
     166        $title['site'] = __( 'WordPress Plugins', 'wporg-plugins' );
     167    }
     168
     169    return $title;
     170}
     171add_filter( 'document_title_parts', __NAMESPACE__ . '\document_title' );
     172
     173/**
    150174 * Shorten excerpt length on index pages, so plugins cards are all the same height.
    151175 *
Note: See TracChangeset for help on using the changeset viewer.