Making WordPress.org

Changeset 2011


Ignore:
Timestamp:
10/27/2015 02:39:39 AM (9 years ago)
Author:
coffee2code
Message:

apps.wordpress.org: Handle deprecation of wp_title().

  • Remove direct output of <title> and use of wp_title().
  • Add add_theme_support( 'title-tag' ).
  • Filter 'document_title_separator' to customize the title separator.
  • Omit page name from title of front page.

Props BandonRandon.
See #1353.

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

Legend:

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

    r843 r2011  
    5757        'gallery',
    5858    ) );
     59
     60    // Enable support for title tag.
     61    add_theme_support( 'title-tag' );
    5962}
    6063endif; // wpmobileapps_setup
     
    191194
    192195/**
     196 * Return the title separator.
     197 *
     198 * @return string
     199 */
     200function wpmobileapps_title_separator(){
     201    return '|';
     202}
     203add_filter( 'document_title_separator', 'wpmobileapps_title_separator' );
     204
     205/**
     206 * Omit page name from front page title.
     207 *
     208 * @param array $parts The document title parts.
     209 * @return array The document title parts.
     210 */
     211function wpmobileapps_remove_frontpage_name_from_title( $parts ) {
     212    if ( is_front_page() ) {
     213        $parts['title'] = '';
     214    }
     215
     216    return $parts; 
     217}
     218add_filter( 'document_title_parts', 'wpmobileapps_remove_frontpage_name_from_title' );
     219
     220/**
    193221 * Remove Jetpack Likes on the grid page template.
    194222 */
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-apps/header.php

    r843 r2011  
    1212<meta charset="<?php bloginfo( 'charset' ); ?>">
    1313<meta name="viewport" content="width=device-width, initial-scale=1">
    14 <title><?php wp_title( '|', true, 'right' ); ?></title>
    1514<link rel="profile" href="http://gmpg.org/xfn/11">
    1615<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
Note: See TracChangeset for help on using the changeset viewer.