Skip to content

Commit

Permalink
Sitemaps: Fix the Hook from init to wp_loaded for Sitemap URL handler. (
Browse files Browse the repository at this point in the history
#34269)

* Update Init hook to WP for generating sitemap URLs and not all post types are registered while this is first initiated.

* Fix hook name to wp_loaded

* Add changelog
  • Loading branch information
rutviksavsani authored Feb 2, 2024
1 parent cd6e09e commit 0905e57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: compat

Sitemaps: Use wp_loaded filter hook instead of init filter hook to load the permalinks for the sitemaps, Which will allow plugins and other hooks to load.
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/modules/sitemaps/sitemaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function __construct() {

// Add callback for sitemap URL handler.
add_action(
'init',
'wp_loaded',
array( $this, 'callback_action_catch_sitemap_urls' ),
defined( 'IS_WPCOM' ) && IS_WPCOM ? 100 : 10
);
Expand Down

0 comments on commit 0905e57

Please sign in to comment.