WordPress.org

Making WordPress.org


Ignore:
Timestamp:
11/05/2015 06:57:12 PM (4 years ago)
Author:
coffee2code
Message:

Make home: Use wp_get_document_title() instead of the deprecated wp_title().

Also ensure front page document title omits front page's title ("Making WordPress").

See #1353.

File:
1 edited

Legend:

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

    r1695 r2044  
    2424    return $classes;
    2525}
     26
     27/**
     28 * Omit page name from front page title.
     29 *
     30 * @param array $parts The document title parts.
     31 * @return array The document title parts.
     32 */
     33function make_remove_frontpage_name_from_title( $parts ) {
     34    if ( is_front_page() ) {
     35        $parts['title'] = '';
     36    }
     37
     38    return $parts; 
     39}
     40add_filter( 'document_title_parts', 'make_remove_frontpage_name_from_title' );
     41
Note: See TracChangeset for help on using the changeset viewer.