bonnier / wp-bonnier-sitemap
Willow平台上的Sitemap插件
Requires
- php: >=7.4
- illuminate/support: ^5.7
Requires (Dev)
- dev-master
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-dependabot/composer/guzzlehttp/psr7-2.5.0
- dev-add-new-release-1-1.6.2
- dev-add-new-release-3-1.6.0
- dev-VOLD-427/hide-from-sitemap
- dev-fix/remove-tags-that-has-militaria
- dev-VOLD-154/set-host-on-sitemap
- dev-Fix-error-for-running-cmd-wp-contenthub-editor-categories-sync
- dev-WILL-1657/implement-author-pages
This package is auto-updated.
Last update: 2024-09-19 23:32:51 UTC
README
WordPress中处理Sitemap的插件
此插件将监视所有公开的WP_Post类型,
过滤器
此插件为WordPress网站的开发商提供了一些过滤器,以便自定义验证和处理要由该插件处理的内容。
WpBonnierSitemap::FILTER_ALLOWED_POST_TYPES = 'sitemap_allowed_post_types'
此过滤器允许您删除或添加由Sitemap插件允许的帖子类型,因此将监听哪些帖子类型的变化。
add_filter('sitemap_allowed_post_types', function(array $postTypes) { // Don't handle sitemaps for the page post type. return array_filter($postTypes, function(string $postType) { return $postType !== 'page'; }); }, 10);
WpBonnierSitemap::FILTER_POST_ALLOWED_IN_SITEMAP = 'post_allowed_in_sitemap'
此过滤器允许您篡改是否将WP_Post放入Sitemap的验证。
默认值:true
add_filter('post_allowed_in_sitemap', function (bool $allowed, \WP_Post $post) { if ($post->post_type !== 'page') { $allowed = false; } return $allowed; }, 10, 2);
WpBonnierSitemap::FILTER_POST_TAG_MINIMUM_COUNT = 'post_tag_minimum_count'
此过滤器允许您定义一个标签需要附加的最少帖子数,以便将其包含在Sitemap中。
默认值:5
add_filter('post_tag_minimum_count', function (int $count) { // For SEO purposes, our sitemap cannot have less than 10 posts for tag pages. return 10; }, 10);
WpBonnierSitemap::FILTER_USER_MINIMUM_COUNT = 'user_minimum_count'
此过滤器允许您定义一个用户需要附加的最少帖子数,以便将其包含在Sitemap中。
默认值:5
add_filter('user_minimum_count', function (int $count) { // For SEO purposes, our sitemap cannot have less than 10 posts for user pages. return 10; }, 10);
WpBonnierSitemap::FILTER_POST_PERMALINK = 'sitemap_post_permalink'
此过滤器允许您更改正在保存的帖子的生成永久链接。
add_filter('sitemap_post_permalink', function (string $permalink, \WP_Post $post) { return $permalink; }, 10, 2);
WpBonnierSitemap::FILTER_CATEGORY_PERMALINK = 'sitemap_category_permalink'
此过滤器允许您更改正在保存的类别的生成永久链接。
add_filter('sitemap_category_permalink', function (string $permalink, \WP_Term $category) { return $permalink; }, 10, 2);
WpBonnierSitemap::FILTER_TAG_PERMALINK = 'sitemap_tag_permalink'
此过滤器允许您更改正在保存的post_tag的生成永久链接。
add_filter('sitemap_tag_permalink', function (string $permalink, \WP_Term $tag) { return $permalink; }, 10, 2);
WpBonnierSitemap::FILTER_TAG_ALLOWED_IN_SITEMAP = 'tag_allowed_in_sitemap'
此过滤器允许您篡改是否将WP_Term放入Sitemap的验证。
默认值:true
add_filter('tag_allowed_in_sitemap', function (bool $allowed, \WP_Term $tag) { if ($tag->taxonomy !== 'post_tag') { $allowed = false; } return $allowed; }, 10, 2);
WpBonnierSitemap::FILTER_ALLOW_USER_IN_SITEMAP = 'allow_user_in_sitemap'
此过滤器允许您为将用户注册到Sitemap表中应用自己的规则。
add_filter('allow_user_in_sitemap', function (bool $allowInSitemap, int $userID, \WP_User $user) { return $allowInSitemap; }, 10, 3);