我正在尝试将一个简单的函数附加到Yoast SEO过滤器挂钩wpseo_sitemap_urlimages
并让函数运行,但我不能这样做。我的代码是:
function tp_filter_wpseo_sitemap_urlimages($images, $post_id) {
error_log("test message");
return $images;
}
add_filter(\'wpseo_sitemap_urlimages\', \'tp_filter_wpseo_sitemap_urlimages\');
为了运行此函数,我尝试打开以下Yoast XML网站地图:站点地图索引(https://example.com/sitemap_index.xml)http://example.com/post-sitemap.xml)http://example.com/page-sitemap.xml)我的最终目标是在Yoast帖子和页面网站地图中添加额外的图像(根据these Yoast instructions).
Yoast对此提供的唯一支持是this page.