diff --git a/wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/page-meta-descriptions.php b/wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/page-meta-descriptions.php index 1bbb2b1ed4..5aa2472d27 100644 --- a/wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/page-meta-descriptions.php +++ b/wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/page-meta-descriptions.php @@ -17,6 +17,7 @@ * @return array Filtered Open Graph tags. */ function custom_open_graph_tags( $tags = [] ) { + global $wporg_global_header_options; // Use `name=""` for description. // See Jetpacks Twitter Card for where it happens for the twitter:* fields. @@ -24,9 +25,9 @@ function custom_open_graph_tags( $tags = [] ) { return str_replace( ' 'website', 'og:title' => __( 'Blog Tool, Publishing Platform, and CMS', 'wporg' ) . " - {$site_title}", @@ -197,59 +198,71 @@ function custom_open_graph_tags( $tags = [] ) { add_filter( 'jetpack_open_graph_tags', __NAMESPACE__ . '\custom_open_graph_tags' ); /** - * Renders site's attributes for Rosetta sites. + * Renders site's attributes for the WordPress.org frontpages (including Rosetta). * * @see https://developers.google.com/search/docs/guides/enhance-site */ function sites_attributes_schema() { - if ( ! is_front_page() || ! isset( $GLOBALS['rosetta'] ) || empty( $GLOBALS['rosetta']->rosetta->glotpress_locale ) ) { + global $rosetta; + + if ( ! is_front_page() ) { return; } - $og_tags = \WordPressdotorg\MainTheme\custom_open_graph_tags(); - $locale = $GLOBALS['rosetta']->rosetta->glotpress_locale; + $og_tags = custom_open_graph_tags(); + $locale_language = 'en'; + $name = 'WordPress.org'; + + if ( ! empty( $rosetta->rosetta->glotpress_locale ) ) { + $locale_language = $rosetta->rosetta->glotpress_locale->slug; + $name = sprintf( + __( 'WordPress - %s', 'wporg' ), + $rosetta->rosetta->glotpress_locale->native_name + ); + } + ?>