Making WordPress.org

Changeset 6968


Ignore:
Timestamp:
03/29/2018 09:06:03 AM (7 years ago)
Author:
ocean90
Message:

WordPress.org Base Theme: Use wp_get_document_title() as default value for the global $pagetitle.

File:
1 edited

Legend:

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

    r6903 r6968  
    5959
    6060    add_theme_support( 'wp4-styles' );
    61 
    62     $GLOBALS['pagetitle'] = __( 'WordPress.org', 'wporg' );
    6361}
    6462add_action( 'after_setup_theme', __NAMESPACE__ . '\setup' );
     63
     64/**
     65 * Sets the document title.
     66 *
     67 * The global $pagetitle is used by the global w.org header.
     68 *
     69 * @global string $pagetitle
     70 */
     71function set_document_title() {
     72    $GLOBALS['pagetitle'] = wp_get_document_title();
     73}
     74add_action( 'template_redirect', __NAMESPACE__ . '\set_document_title' );
    6575
    6676/**
Note: See TracChangeset for help on using the changeset viewer.