Making WordPress.org

Changeset 11433


Ignore:
Timestamp:
01/12/2022 07:33:18 AM (5 years ago)
Author:
dd32
Message:

Translate: Use title-tag support for GlotPress titles.

This is a bit hacky as GlotPress doesn't use WordPress titles or headers, but it works.

See ​https://github.com/WordPress/wporg-mu-plugins/issues/44

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/header.php

    r11402 r11433  
    11<?php
     2
     3add_theme_support( 'title-tag' );
     4add_action( 'gp_head', '_wp_render_title_tag' );
     5add_filter( 'document_title_parts', function() {
     6        return [
     7                'title' => gp_title(),
     8        ];
     9}, 1 );
    210
    311if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {
    412        echo do_blocks( '<!-- wp:wporg/global-header /-->' );
    513} else {
    6         global $pagetitle;
    7         $pagetitle = gp_title();
    814        require WPORGPATH . 'header.php';
    915}
Note: See TracChangeset for help on using the changeset viewer.