torounit / custom-post-type-permalinks
编辑自定义文章类型的永久链接!
3.5.2
2023-08-23 17:13 UTC
Requires
- php: >=7.4
- dev-master
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.5
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.4.0-rc.1
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- dev-ci/php82
- dev-test-for-php-8
- dev-post-type-and-taxonomy-object
- dev-fix-get_permalink_structure
This package is auto-updated.
Last update: 2024-09-23 08:13:10 UTC
README
贡献者:Toro_Unit, inc2734, ixkaito, keita_kobayashi, strategio
捐赠链接:https://www.paypal.me/torounit
标签:永久链接,URL,链接,地址,自定义文章类型
最低要求:6.1
已测试到:6.3
需要PHP:7.4
许可证:GPLv2或更高版本
许可证URI:https://gnu.ac.cn/licenses/gpl-2.0.txt
稳定标签:3.5.2
编辑自定义文章类型的永久链接。
描述
自定义文章类型永久链接允许您编辑自定义文章类型的永久链接结构。
将自定义分类存档的永久链接更改为 "example.org/post_type/taxonomy_name/term_slug"。可以禁用此修复。
并支持 wp_get_archives( 'post_type=foo' )
和文章类型日期存档(例如,example.com/post_type_slug/date/2010/01/01
)。
翻译者
- 日语(ja) - Toro_Unit
- 法语(fr_FR) - Geoffrey Crofte
- 俄语(ru_RU) - Olart,Natali_Z
也请查看
代码设置
示例
register_post_type( 'foo', array( 'public' => true, 'has_archive' => true, 'rewrite' => array( "with_front" => true ), 'cptp_permalink_structure' => '%post_id%' ) );
排除特定文章类型
add_filter( 'cptp_is_rewrite_supported_by_foo', '__return_false' ); // or add_filter( 'cptp_is_rewrite_supported', function ( $support , $post_type ) { if ( 'foo' === $post_type ) { return false; } return $support; }, 10, 2);
安装
- 将 custom-post-type-permalinks.zip 文件下载到您的计算机上。
- 解压文件。
- 将
custom-post-type-permalinks
目录上传到您的/wp-content/plugins/
目录。 - 通过WordPress的“插件”菜单激活插件。
就是这样。您可以通过访问 设置 -> 永久链接 来访问永久链接设置。
屏幕截图
- screenshot-1.png
变更日志
3.5.0
- 已测试WP 6.1 / 6.2 / 6.3
- 已测试PHP 8.0 / 8.2
3.4.5
- 更新测试为WP 5.7
3.4.4
- WPML支持:仅当文章类型受支持时应用slug翻译。(归功于@ffauvel)
3.4.3
- 修复存档链接错误。
3.4.2
- 已测试WP 5.6。
3.4.1
- 修复readme。
3.4.0
- 测试5.5 beta3
- WPML支持:自定义文章类型slug翻译。(归功于@strategio)
- 添加新过滤器
cptp_post_link_category
和cptp_post_link_term
。 - 为操作和过滤器使用小写前缀。
3.3.5
- 已测试5.4
- 修复 CPTP_Module_Permalink::post_type_link。
3.3.1
- 为日期/作者和文章类型存档添加禁用选项。
- 修复
parse_request
的错误。
3.2.2
- 修复 readme.txt。
3.2.0
- 仅支持公开文章类型。
- 添加
CPTP_is_rewrite_supported_by_${post_type}
和CPTP_is_rewrite_supported
过滤器。 - 移除 post_type 查询 wp_get_archives。
3.1.4
- 对WordPress 4.9进行测试。
- PHPCS修复。
3.1.3
- 对WordPress 4.8进行测试。
- 修复附件链接错误。
3.1.1
- 修复
CPTP_Module_Setting::upgrader_process_complete
中的错误。
3.1.0
- 添加过滤器
CPTP_date_front
。 - 修复通过
wp_list_sort
排序术语。
3.0.0
- 在更新插件时显示管理员通知。
- 修复了大漏洞。
- 修复了no_taxonomy_structure漏洞。
- 为选项添加默认值。
2.2.0
- 添加了
CPTP_Util::get_no_taxonomy_structure
。
2.1.3
- 将
no_taxonomy_structure
的默认值设置为true
。
2.1.2
- 支持
rewirte => false
帖子类型。
2.1.0
- 在
registered_post_type
和registered_taxonomy
操作上创建重写规则。 - 当
rewrite
为false
时,不创建分类重写规则。
2.0.2
- 修复了指针HTML漏洞。
2.0.0
- 将
add_rewrite_rules
在wp_loaded
优先级从100改为10。 修复问题#53 - 用
get_the_terms
替换wp_get_post_terms
。 修复问题#55 - 修复了每个页面上两次调用
register_uninstall_hook
的漏洞。 修复问题#56
1.5.4
- 解决了删除父帖子的问题。
1.5.3
- 修复了readme。
1.5.0
- 测试了4.5。
- 添加过滤器
CPTP_set_{$module_name}_module
。
1.4.0
- 修复了翻译问题。
1.3.1
- 修复了
wp_get_archives
漏洞。
1.3.0
- 修复了polylang漏洞。
1.2.0
- 添加过滤器
cptp_post_type_link_priority
,cptp_term_link_priority
,cptp_attachment_link_priority
。 - 添加操作
CPTP_registered_modules
。
1.1.0
- WPML测试。感谢keita_kobayashi!
1.0.5
1.0.4
- 修复了选项漏洞。
1.0.3
- 添加分类规则,如果只有附件分类到帖子类型。
1.0.2
- 修复了分类别名漏洞。
1.0.0
- 在
register_post_type
上设置允许使用别名。 - 允许将帖子类型查询添加到分类存档中。
- 使用类自动加载。
- 在
wp_loaded
动作上创建重写规则。 - 修复了WordPress代码格式。
CPTP_Module_Permalink
漏洞修复。- 漏洞修复。
- 使用语义化版本。
- 修复了日期结构。
- 使用分类基础。
0.9.7
- 仅当冲突时才添加日期别名
%post_id%
。 - 更改分类链接重写规则。使用
post_type
。 - 可以更改包含自定义分类的模板。
0.9.6
- 分类和作者。
- 法语翻译。感谢Geoffrey!
- 修复了分层术语。
0.9.5.6
- 修复了严格标准错误。
0.9.5.4
- 修复了存档链接漏洞。
- 测试升级到3.9。
0.9.5.3
- 修复了“/”漏洞。
- 修复了分类模板漏洞。
0.9.5.2
- 修复了存档重写。
0.9.5.1
- 修复了管理员漏洞。
0.9.5
- 大改插件架构。
- 显示
has_archive
,with_front
。
0.9.4
- 内部发布。
0.9.3.3
- 修复了
has_archive
漏洞。 - 修复了链接中包括扩展的漏洞。
0.9.3.2
- 修复了
wp_get_archives
漏洞。
0.9.3.1
- 测试了3.6。
- 漏洞修复。
0.9.3
- 修复了管理员页面。
- 修复了单页分页链接。
- 添加俄语翻译。
0.9
- 当
has_archive
为true
时,仅添加自定义帖子类型存档。 - 更改方法名称。
- 更改自定义帖子链接钩子。
- 在
wp_get_archive()
中使用别名。 - 修复了附件链接。
0.8.7
- 翻译漏洞修复。
0.8.6
- 分页漏洞修复。
- 评论分页。
- 显示指针。
0.8.1
- 漏洞修复。
0.7.9.1
- 支持评论别名。
- 设置页面的小改动。
- 更改默认值。
- 漏洞修复。
0.7.8
- 修复了漏洞。
0.7.7
- 修复了漏洞。
0.7.6
- 将父级的别名添加到分层帖子类型中。
0.7.5
- 添加了禁用更改自定义分类存档的别名的功能。
0.7.4
- 修复了分类重写漏洞。
0.7.3
- 更改了保存数据的部分。
0.7.2
- 重写漏洞修复。
- 预览漏洞修复。
0.7.1
- 修复了漏洞。
0.7
- 添加
%{taxonomy}%
标签。 - 大量漏洞修复。
- 更改设置页面。使用设置API。
0.6.2
- 修复了
%author%
标签。
0.6
- 在wordpress.org上首次发布。