2012-04-19, 10:33:55
Carlos Wrote:More or less the same as in post #13, but using a new filter (instead of an action):
Code:function generate_sitemap() {
$nositemap = exec_filter('replace-sitemap',FALSE); // a plugin could return TRUE here
if ($nositemap) return TRUE;
// ... GS code for generating the sitemap
Opinions? Better than a GSNOSITEMAP gsconfig setting as I also suggested?
Instead of all that, maybe just use a global for the sitemap itself (xml or array or object), before creating it, call the hook, if after the hook the global is no longer empty then something already made a sitemap for us so we exit.
Also i think exec_action uses call_user_func which is anonymous and will never get the return value, actually since exec action loops its not possible to even have a return, or else it would break the loop.