Making WordPress.org


Ignore:
Timestamp:
08/09/2018 08:58:06 PM (8 years ago)
Author:
obenland
Message:

Plugins/Themes: Add CPT to Jetpack sitemaps

See #3540.

File:
1 edited

Legend:

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

    r7048 r7600  
    4040                add_filter( 'rest_api_allowed_post_types', array( $this, 'filter_allowed_post_types' ) );
    4141                add_filter( 'pre_update_option_jetpack_options', array( $this, 'filter_jetpack_options' ) );
     42                add_filter( 'jetpack_sitemap_post_types', array( $this, 'jetpack_sitemap_post_types' ) );
    4243                add_action( 'template_redirect', array( $this, 'prevent_canonical_for_plugins' ), 9 );
    4344                add_action( 'template_redirect', array( $this, 'custom_redirects' ), 1 );
     
    12331234                echo $icon->toSVG();
    12341235                die();
     1236        }
     1237
     1238        /**
     1239         * The array of post types to be included in the sitemap.
     1240         *
     1241         * @param array $post_types List of included post types.
     1242         * @return array
     1243         */
     1244        public function jetpack_sitemap_post_types( $post_types ) {
     1245                $post_types[] = 'plugin';
     1246
     1247                return $post_types;
    12351248        }
    12361249
Note: See TracChangeset for help on using the changeset viewer.