sectsect / wp-tag-order
在WordPress中手动对单个文章的标签进行排序。
v3.7.2
2024-09-01 04:06 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^7.5 || ^9.5
- squizlabs/php_codesniffer: ^3.7
- szepeviktor/phpstan-wordpress: ^1.3
- wp-coding-standards/wpcs: ^3.0
- yoast/phpunit-polyfills: ^2.0
- dev-master
- v3.7.2
- v3.7.1
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.1
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.0
- v2.2.5
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.0
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-bugfix/71-deprecated-filter
- dev-dependabot/npm_and_yarn/webpack-5.94.0
- dev-php7
- dev-feature/code-coverage
- dev-feature/type-hinting
- dev-feature/migration-ci
This package is auto-updated.
Last update: 2024-09-01 04:23:48 UTC
README
在WordPress中,使用简单的拖放排序功能独立地对每篇文章的标签进行排序(不是全局站点)。
重要
此插件与WordPress 5.x中的Gutenberg不兼容。请考虑使用经典编辑插件。
重要
突变事件将在2024年7月不再被Google Chrome和Edge支持(Google Chrome将于2024年7月23日,Microsoft Edge将于2024年7月25日一周内)。因此,WP Tag Order 3.6.0或更低版本将无法与Chrome v127及更高版本一起工作,该版本将于2024年7月23日发布。
您必须更新到v3.7.0或更高版本。
如果您仍然需要PHP7支持,请参阅下面的故障排除。
有关更多详细信息,请参阅Chrome开发者博客。
开始使用
- 将此存储库克隆到您的
wp-content/plugins
目录中。
$ cd /path-to-your/wp-content/plugins/
$ git clone git@github.com:sectsect/wp-tag-order.git
- 通过WordPress中的
插件
菜单激活插件。 - 转到
设置
->WP Tag Order
页面以选择要启用排序的术语。
功能
- 支持
post_tag
和非层级术语
。 - 支持在文章类型中支持多个
非层级术语
。 - 支持多站点。
注意
- 在创建新文章时,您需要保存一次以启用标签排序。
- 要将排序应用于现有文章,请先添加和删除任何标签。
- 要一次性批量更新多个文章,请转到
设置
->WP Tag Order
页面并点击高级设置下的 '应用'。
- 在WordPress v6.3.1上进行了测试。
要求
- WordPress 5.6+
- PHP 8.0+
APIs
使用示例
get_the_tags_ordered()
<?php $terms = get_the_tags_ordered(); if ( $terms && ! is_wp_error( $terms ) ) : ?> <ul> <?php foreach ( $terms as $term ) : ?> <li> <a href="<?php echo get_term_link( $term->slug, 'post_tag' ); ?>"> <?php echo $term->name; ?> </a> </li> <?php endforeach; ?> </ul> <?php endif; ?>
get_the_terms_ordered()
<?php $terms = get_the_terms_ordered( $post->ID, 'post_tag' ); if ( $terms && ! is_wp_error( $terms ) ) : ?> <ul> <?php foreach ( $terms as $term ) : ?> <li> <a href="<?php echo get_term_link( $term->slug, 'post_tag' ); ?>"> <?php echo $term->name; ?> </a> </li> <?php endforeach; ?> </ul> <?php endif; ?>
get_the_tag_list_ordered()
<?php echo get_the_tag_list_ordered(); ?>
get_the_term_list_ordered()
<?php echo get_the_term_list_ordered( $post->ID, 'post_tag' ); ?>
the_tags_ordered()
<?php the_tags_ordered(); ?>
the_terms_ordered()
<?php the_terms_ordered( $post->ID, 'post_tag' ); ?>
开发者
-
有序标签数据被序列化并存储在
wp_postmeta
表中,键如wp-tag-order-{taxonomy}
。 -
此插件没有在wordpress.org仓库中托管,以防止来自广泛受众的大量支持请求。您的反馈受到欢迎。
故障排除
仍然需要PHP 7的支持。
我有一个php7分支,用于支持PHP 7和JavaScript突变事件的结束。
此分支将不再维护,因此我建议您迁移到PHP 8。
更改日志
查看CHANGELOG文件。
许可
查看LICENSE文件。
✌️
由@sectsect发起的一个小项目