New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter wpseo_sitemaps_providers never executed #7561
Comments
Filter https://github.com/Yoast/wordpress-seo/blob/trunk/wp-seo-main.php#L366 So, this filter can't be triggered by code in the theme. It's possible to move initialization of providers later. It could be solution. |
Hi stodorovic, Your comment makes sense why I couldn't load it from the theme. |
Hi @edwinsiebel I just created PR #7574, so you can see what I mean. There are some errors (some tests are failed on older PHP versions), I'm not sure why, but I'll check it. |
@stodorovic Thanks for writing this code! We've reviewed and tested your PR and merged it. |
Hi @thulshof, Thanks for integrating this feature. Will this be the new and recommended way to include external sitemaps to the main sitemap index? |
@edwinsiebel You're welcome! Yes, this will be the new way to include external sitemaps. |
Please give us a description of what happened.
I am trying to add a new sitemap provider through the
wpseo_sitemaps_providers
filter in class-sitemaps.php. However, for some reason, the filter is never executed and thus never altered.Please describe what you expected to happen and why.
I've added the filter:
to my functions.php of my active theme, however, nothing is added to the $this-providers list of the WPSEO_Sitemaps class.
I know it has nothing to do with the filter, but I have implemented the \WPSEO_Sitemap_Provider interface for my CustomSitemapProvider class.
How can we reproduce this behavior?
Technical info
The text was updated successfully, but these errors were encountered: