Skip to content

Commit

Permalink
Add support for Jetpack Sitemaps (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored Mar 7, 2024
1 parent a01fb7b commit 5c0be80
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
add_action( 'init', __NAMESPACE__ . '\add_preview_endpoint' );
add_action( 'setup_theme', __NAMESPACE__ . '\setup_preview_theme', 1 );
add_action( 'template_include', __NAMESPACE__ . '\load_pattern_preview', 100 );
add_filter( 'jetpack_sitemap_post_types', __NAMESPACE__ . '\jetpack_sitemap_post_types' );

/**
* Registers post types and associated taxonomies, meta data, etc.
Expand Down Expand Up @@ -1027,3 +1028,16 @@ function get_pattern_unlisted_reason( $post_id ) {

return '';
}

/**
* Allow the Patterns to be included in the Jetpack Sitemaps.
*
* @param array $post_types The post types to include.
*
* @return array
*/
function jetpack_sitemap_post_types( $post_types ) {
$post_types[] = POST_TYPE;

return $post_types;
}

0 comments on commit 5c0be80

Please sign in to comment.