Making WordPress.org


Ignore:
Timestamp:
02/12/2020 04:01:16 AM (7 years ago)
Author:
dd32
Message:

Theme Directory: Disable Jetpack Sitemaps on Rosetta sites.

See #5023.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php

    r9471 r9500  
    218218}
    219219add_filter( 'jetpack_sitemap_post_types', 'wporg_themes_sitemap_post_types' );
     220
     221/**
     222 * Disable the Jetpack Sitemap feature when running on rosetta.
     223 */
     224function wporg_themes_disable_sitemap_for_rosetta( $modules ) {
     225        if ( !empty( $GLOBALS['rosetta'] ) ) {
     226                if ( false !== ( $i = array_search( 'sitemaps', $modules ) ) ) {
     227                        unset( $modules[$i] );
     228                }
     229        }
     230
     231        return $modules;
     232}
     233add_filter( 'jetpack_active_modules', 'wporg_themes_disable_sitemap_for_rosetta' );
    220234
    221235/**
Note: See TracChangeset for help on using the changeset viewer.