WordPress.org

Making WordPress.org

Changeset 9260


Ignore:
Timestamp:
11/04/2019 03:59:51 AM (5 weeks ago)
Author:
tellyworth
Message:

Main theme: use meta description tags on pages.

Fixes #4797

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/page-meta-descriptions.php

    r9220 r9260  
    1818function custom_open_graph_tags( $tags = [] ) {
    1919
     20    // Use `name=""` for description.
     21    // See Jetpacks Twitter Card for where it happens for the twitter:* fields.
     22    add_filter( 'jetpack_open_graph_output', function( $html ) {
     23        return str_replace( '<meta property="description"', '<meta name="description"', $html );
     24    } );
     25
    2026    // Override the Front-page tags on Rosetta sites.
    2127    if ( is_front_page() && isset( $GLOBALS['rosetta'] ) ) {
    22 
    23         // Use `name=""` for description.
    24         // See Jetpacks Twitter Card for where it happens for the twitter:* fields.
    25         add_filter( 'jetpack_open_graph_output', function( $html ) {
    26             return str_replace( '<meta property="description"', '<meta name="description"', $html );
    27         } );
    28 
    2928        $site_title = isset( $GLOBALS['wporg_global_header_options']['rosetta_title'] ) ? $GLOBALS['wporg_global_header_options']['rosetta_title'] : 'WordPress.org';
    3029        return array(
     
    175174    $tags['og:description']      = $desc;
    176175    $tags['twitter:description'] = $desc;
     176    $tags['description']         = $desc;
    177177
    178178    return $tags;
Note: See TracChangeset for help on using the changeset viewer.