Automattic / msm-sitemap

Comprehensive sitemaps for your WordPress VIP site. Joint collaboration between Metro.co.uk, WordPress VIP, Alley Interactive, Maker Media, 10up, and others.
74 stars 37 forks source link

Add Post ID to msm_sitmap_skip_posts #184

Open BrookeDot opened 3 weeks ago

BrookeDot commented 3 weeks ago

This PR adds $post_id to the msm_sitmap_skip_posts filter. Doing so allows for posts to be excluded by using the filter directly.

Note: this is a backward incompatible change, as it adds a second argument to the filter

Fixes #183

pkevan commented 3 weeks ago

This will probably need to be tested with someone using the filter currently, as I can't find any examples!

BrookeDot commented 2 weeks ago

Makes sense @pkevan the other thought I had was to support both (adding a new filter for the addition of $post_id) something like msm_sitmap_skip_posts_by_id and then fire a doing_it_wrong when the old filter is used.

Thoughts?

pkevan commented 2 weeks ago

Probably preferable just to have one filter - in theory it shouldn't break by adding a parameter (as 1 parameter is the default for all filters), but depends on how legacy application have been calling it.