Closed kasparsd closed 5 years ago
This is ready for code review.
How about a test to demonstrate and prove how this new filter works in practice?
@GaryJones Are you thinking of a unit test for the filter? I'm not sure exactly what to test there since it is only a pass-through for a variable and the result depends purely on the filter implementation. In a pure unit test way it would just check if apply_filters()
was called during build_root_sitemap_xml()
.
We've already added an example to the readme to illustrate a sample usage.
Did you have any other ideas in mind?
In a pure unit test way it would just check if
apply_filters()
was called duringbuild_root_sitemap_xml()
.
Right - we're not testing how apply_filters()
works, only that build_root_sitemap_xml()
has the behaviour / logic such that the value is filterable.
I don't see any tests for build_root_sitemap_xml
, but it appears that to test this I would need to:
create_dummy_post
MSM_SiteMap_Test::build_sitemaps
build_root_sitemap_xml
contains two date nodes@GaryJones, does this sound right? Also should this be added to test-sitemap-functions.php
, test-sitemap-filter.php
or somewhere else?
Fixes #146.
msm_sitemap_index
filter which allows removing daily sitemaps from the root sitemap index.