Making WordPress.org


Ignore:
Timestamp:
11/26/2018 07:24:30 AM (6 years ago)
Author:
dd32
Message:

WordPress.org: Main: Rosetta: Define the og: and twitter: metadata for rosetta sites to match those of WordPress.org.

This fixes the rather incomplete and incorrect data generated from the placeholder front-page.

Fixes #3940.

File:
1 edited

Legend:

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

    r7418 r7900  
    1717 */
    1818function custom_open_graph_tags( $tags = [] ) {
     19
     20    // Override the Front-page tags on Rosetta sites.
     21    if ( is_front_page() && isset( $GLOBALS['rosetta'] ) ) {
     22
     23        $locale_native_name = $GLOBALS['rosetta']->rosetta->glotpress_locale->native_name;
     24        return array(
     25            'og:type'         => 'website',
     26            'og:title'        => __( 'Blog Tool, Publishing Platform, and CMS - WordPress', 'wporg' ),
     27            'og:description'  => __( 'Open source software which you can use to easily create a beautiful website, blog, or app.', 'wporg' ),
     28            'og:url'          => home_url( '/' ),
     29            /* translators: %s - The Locale native name. */
     30            'og:site_name'    => sprintf( __( 'WordPress - %s', 'wporg' ), $locale_native_name ),
     31            'og:image'        => 'https://s.w.org/images/home/screen-themes.png?3',
     32            'og:locale'       => get_locale(),
     33            'twitter:card'    => 'summary_large_image',
     34            'twitter:creator' => '@WordPress',
     35        );
     36    }
     37
    1938    $post = get_post();
    2039    if ( ! $post || 'page' !== $post->post_type ) {
Note: See TracChangeset for help on using the changeset viewer.