diggy / polylang-cli
Polylang 插件的 CLI 工具
Requires
- wp-cli/wp-cli: ~1.5.0
Requires (Dev)
- behat/behat: 2.5.*
This package is not auto-updated.
Last update: 2024-09-28 20:03:42 UTC
README
Polylang 插件的 CLI 工具
安装
安装此包需要 WP-CLI v1.5.0 或更高版本。使用 wp cli update
更新到最新稳定版本。完成后,您可以使用 wp package install git@github.com:diggy/polylang-cli.git
安装此包。
使用
此包实现了以下命令
wp pll api
检查 Polylang 程序性 API 函数。
wp pll api
wp pll api list
列出 Polylang 程序性 API 函数。
wp pll api list [--format=<format>]
选项
[--format=<format>]
Accepted values: table, csv, json, count, yaml. Default: table
示例
$ wp pll api list
$ wp pll api list --format=csv
wp pll cache
检查和管理 Polylang 语言缓存。
wp pll cache
wp pll cache clear
清除 Polylang 语言缓存。
wp pll cache clear
示例
$ wp pll cache clear
Success: Languages cache cleared.
$ wp pll cache clear --quiet
wp pll cache get
获取 Polylang 语言缓存。
wp pll cache get [--format=<format>]
选项
[--format=<format>]
Accepted values: table, csv, json, count, yaml. Default: table
示例
$ wp pll cache get --format=json
Success: There are 1 items in the languages cache:
[{"term_id":2,"name":"Nederlands","slug":"nl","term_group":0,"term_taxonomy_id":2,"taxonomy":"language","description":"nl_NL","parent":0,"count":6259,"tl_term_id":3,"tl_term_taxonomy_id":3,"tl_count":42,"locale":"nl_NL","is_rtl":0,"flag_url":"","flag":"","home_url":"http:\/\/example.dev\/nl\/","search_url":"http:\/\/example.dev\/nl\/","host":null,"mo_id":"3","page_on_front":false,"page_for_posts":false,"filter":"raw","flag_code":""}]
$ wp pll cache get --format=csv --quiet
term_id,name,slug,term_group,term_taxonomy_id,taxonomy,description,parent,count,tl_term_id,tl_term_taxonomy_id,tl_count,locale,is_rtl,flag_url,flag,home_url,search_url,host,mo_id,page_on_front,page_for_posts,filter,flag_code
2,Nederlands,nl,0,2,language,nl_NL,0,10,3,3,42,nl_NL,0,,,http://example.dev/nl/,http://example.dev/nl/,,3,,,raw,
wp pll doctor
解决 Polylang 问题。
wp pll doctor
wp pll doctor check
列出未翻译的文章和术语对象(可翻译)。
wp pll doctor check [--format=<format>]
选项
[--format=<format>]
Render output in a particular format.
---
default: table
options:
- table
- csv
- json
- count
- yaml
---
示例
wp pll doctor check
wp pll doctor language
批量安装、更新和修剪核心、主题和插件语言文件。
wp pll doctor language
示例
$ wp pll doctor language
wp pll doctor recount
重新计算分配给每个语言分类术语的文章数量。
wp pll doctor recount
在手动更新数据库中分配给文章的术语的情况下,与实际文章数量不一致。
此命令在语言分类术语上运行 wp_update_term_count(),将计数恢复到正确值。
示例
wp pll doctor recount
wp pll doctor translate
批量翻译未翻译的文章和分类。
wp pll doctor translate
示例
wp pll doctor translate
wp pll flag
检查和管理 Polylang 国家旗帜。
wp pll flag
wp pll flag list
列出 Polylang 国家旗帜。
wp pll flag list [--format=<format>]
选项
[--format=<format>]
Accepted values: table, csv, json, count, yaml. Default: table
示例
$ wp pll flag list
$ wp pll flag list --format=csv
wp pll flag set
设置语言的国家旗帜。
wp pll flag set <language-code> <flag-code>
运行 wp pll flag list
获取有效旗帜值的列表。将空字符串作为第二个参数传递以删除旗帜值。
选项
<language-code>
Language code (slug) for the language to update. Required.
<flag-code>
Valid flag code for the language to update. Required.
示例
# set flag for Dutch language
$ wp pll flag set nl nl
# delete flag for Dutch language
$ wp pll flag set nl ""
wp pll lang
管理 Polylang 语言分类和分类术语。
wp pll lang
wp pll lang create
创建一种语言。
wp pll lang create <name> <language-code> <locale> [--rtl=<bool>] [--order=<int>] [--flag=<string>] [--no_default_cat=<bool>]
选项
<name>
Language name (used only for display). Required.
<language-code>
Language code (slug, ideally 2-letters ISO 639-1 language code). Required.
<locale>
WordPress locale. Required.
[--rtl=<bool>]
Right-to-left or left-to-right. Optional. Default: false
[--order=<int>]
Language order. Optional.
[--flag=<string>]
Country code, see flags.php. Optional.
[--no_default_cat=<bool>]
If set, no default category will be created for this language. Optional.
示例
$ wp pll lang create Français fr fr_FR
$ wp pll lang create Arabic ar ar_AR --rtl=true --order=3
$ wp pll lang create --prompt
1/7 <name>: Français
2/7 <language-code>: fr
3/7 <locale>: fr_FR
4/7 [--rtl=<bool>]: 0
5/7 [--order=<int>]: 5
6/7 [--flag=<string>]: fr
7/7 [--no_default_cat=<bool>]:
Success: Language added.
wp pll lang delete
删除一个、一些或所有语言。
wp pll lang delete [<language-code>] [--all] [--keep_default]
删除 Polylang 语言并卸载如果未被其他语言使用的核心语言包。
选项
[<language-code>]
Comma-separated slugs of the languages to delete.
[--all]
Delete all languages
[--keep_default]
Whether to keep the default language.
示例
# delete the Afrikaans language and uninstall the `af` WordPress core language pack
$ wp pll lang delete af
Success: Language deleted. af (af)
Success: Language uninstalled.
# delete all languages including the default language
$ wp pll lang delete --all
# delete all languages except the default language
$ wp pll lang delete --all --keep_default
wp pll lang generate
生成一些语言。
wp pll lang generate [--count=<number>]
选项
[--count=<number>]
How many languages to generate. Default: 10
示例
wp pll lang generate --count=25
wp pll lang get
获取一种语言。
wp pll lang get <language-code> [--field=<field>] [--fields=<fields>] [--format=<format>]
选项
<language-code>
ID of the term to get
[--field=<field>]
Instead of returning the whole term, returns the value of a single field.
[--fields=<fields>]
Limit the output to specific fields. Defaults to all fields.
[--format=<format>]
Accepted values: table, json, csv, yaml. Default: table
示例
wp pll lang get en --format=json
wp pll lang list
列出已安装的语言。
wp pll lang list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>] [--pll=<value>]
列出已安装的语言作为 Polylang 对象。传递 --pll=0
将输出 wp term list language
的结果
选项
[--<field>=<value>]
Filter by one or more fields (see get_terms() $args parameter for a list of fields).
[--field=<field>]
Prints the value of a single field for each term.
[--fields=<fields>]
Limit the output to specific object fields.
[--format=<format>]
Accepted values: table, csv, json, count, yaml. Default: table
[--pll=<value>]
Pass 0 to list languages as WP term objects.
可用字段(Polylang 对象)
以下字段将默认显示每个术语
- term_id
- name
- slug
- term_group
- count
- locale
- is_rtl
- flag_code
- term_taxonomy_id
- taxonomy
- description
- parent
- tl_term_id
- tl_term_taxonomy_id
- tl_count
- flag_url
- flag
- home_url
- search_url
- host
- mo_id
- page_on_front
- page_for_posts
- filter
可用字段(WP 术语对象)
以下字段将默认显示每个术语
- term_id
- term_taxonomy_id
- name
- slug
- description
- parent
- count
没有可选的字段。
示例
# list languages as wp term objects
$ wp pll lang list --pll=0
# list properties of languages as Polylang objects
$ wp pll lang list --fields=host,mo_id,flag_code
wp pll lang update
更新语言。
wp pll lang update <language-code> [--name=<name>] [--slug=<slug>] [--locale=<locale>] [--rtl=<bool>] [--order=<int>] [--flag=<string>]
选项
<language-code>
Language code (slug) for the language to update. Required.
[--name=<name>]
A new name for the language (used only for display). Optional.
[--slug=<slug>]
A new language code for the language (ideally 2-letters ISO 639-1 language code). Optional.
[--locale=<locale>]
Optional. A new WordPress locale for the language.
[--rtl=<bool>]
Optional. RTL or LTR, 1 or 0
[--order=<int>]
Optional. A new order (term_group) value for the language.
[--flag=<string>]
Optional. A new flag (country code) for the language, see flags.php.
示例
wp pll lang update en --name=English --order=15
wp pll lang url
获取语言的URL。
wp pll lang url <language-code>
选项
<language-code>
The language code (slug) to get the URL for. Required.
示例
wp pll lang url en
wp pll lang url es
wp pll menu
管理WP导航菜单。
wp pll menu
wp pll menu create
为每种语言创建一个新菜单,并将其分配给一个位置。
wp pll menu create <menu-name> <location> [--porcelain]
选项
<menu-name>
A descriptive name for the menu.
<location>
Location’s slug.
[--porcelain]
Output just the new menu ids.
示例
$ wp pll menu create "Primary Menu" primary
Success: Assigned location to menu.
Success: Assigned location to menu.
Success: Assigned location to menu.
$ wp pll menu create "Secondary Menu" secondary --porcelain
21 22 23
wp pll option
检查和管理Polylang设置。
wp pll option
wp pll option default
获取或设置默认语言。
wp pll option default [<language-code>]
选项
[<language-code>]
Optional. The language code (slug) to set as default.
示例
$ wp pll option default
$ wp pll option default nl
wp pll option get
获取Polylang设置。
wp pll option get <option_name> [--format=<format>]
选项
<option_name>
Option name. Use the options subcommand to get a list of accepted values. Required.
[--format=<format>]
Get value in a particular format.
---
default: var_export
options:
- var_export
- json
- yaml
---
示例
$ wp pll option get default_lang
wp pll option list
列出Polylang设置。
wp pll option list [--format=<format>]
选项
[--format=<format>]
Accepted values: table, csv, json, count, yaml. Default: table
示例
$ wp pll option list
$ wp pll option list --format=csv
wp pll option reset
重置Polylang设置。
wp pll option reset
示例
$ wp pll option reset
wp pll option sync
启用跨语言之间的文章元数据同步。
wp pll option sync <item>
接受值
- taxonomies
- post_meta
- comment_status
- ping_status
- sticky_posts
- post_date
- post_format
- post_parent
- _wp_page_template
- menu_order
- _thumbnail_id
选项
<item>
Item, or comma-separated list of items, to sync. Required.
示例
$ wp pll option sync taxonomies,post_meta
Success: Polylang `sync` option updated.
wp pll option unsync
禁用跨语言之间的文章元数据同步。
wp pll option unsync <item>
接受值
- taxonomies
- post_meta
- comment_status
- ping_status
- sticky_posts
- post_date
- post_format
- post_parent
- _wp_page_template
- menu_order
- _thumbnail_id
选项
<item>
Item, or comma-separated list of items, to unsync. Required.
示例
$ wp pll option unsync post_format,_wp_page_template
Success: Polylang `sync` option updated.
wp pll option update
更新Polylang设置。
wp pll option update <option_name> <new_value>
选项
<option_name>
Option name. Use the options subcommand to get a list of accepted values. Required.
<new_value>
New value for the option. Required.
示例
$ wp pll option update default_lang nl
wp pll post
管理文章及其翻译。
wp pll post
wp pll post count
计算某种语言的文章数量。
wp pll post count <language-code> [--post_type=<post_type>]
选项
<language-code>
The language code (slug) to get the post count for. Required.
[--post_type=<post_type>]
One or more post types to get the count for for. Default: post. Optional.
示例
wp pll post count nl
wp pll post count es --post_type=page
wp pll post generate
生成一些文章及其翻译。
wp pll post generate [--count=<number>] [--post_type=<type>] [--post_status=<status>] [--post_author=<login>] [--post_date=<yyyy-mm-dd>] [--post_content] [--max_depth=<number>] [--format=<format>]
创建指定数量的带有虚拟数据的新文章集。
选项
[--count=<number>]
How many posts to generate?
---
default: 5
---
[--post_type=<type>]
The type of the generated posts.
---
default: post
---
[--post_status=<status>]
The status of the generated posts.
---
default: publish
---
[--post_author=<login>]
The author of the generated posts.
---
default:
---
[--post_date=<yyyy-mm-dd>]
The date of the generated posts. Default: current date
[--post_content]
If set, the command reads the post_content from STDIN.
[--max_depth=<number>]
For hierarchical post types, generate child posts down to a certain depth.
---
default: 1
---
[--format=<format>]
Render output in a particular format.
---
default: ids
options:
- progress
- ids
---
示例
# Generate posts.
$ wp pll post generate --count=10 --post_type=page --post_date=1999-01-04
Generating posts 100% [================================================] 0:01 / 0:04
# Generate posts with fetched content.
$ curl http://loripsum.net/api/5 | wp pll post generate --post_content --count=10
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2509 100 2509 0 0 616 0 0:00:04 0:00:04 --:--:-- 616
Generating posts 100% [================================================] 0:01 / 0:04
# Add meta to every generated posts.
$ wp pll post generate --format=ids | xargs -d ' ' -I % wp post meta add % foo bar
Success: Added custom field.
Success: Added custom field.
Success: Added custom field.
wp pll post create
创建一个新文章及其翻译。
wp pll post create --post_type=<type> [--<field>=<value>] [--stdin] [--porcelain]
选项
--post_type=<type>
The type of the new posts. Required.
[--<field>=<value>]
Associative args for the new posts. See wp_insert_post(). These values will take precendence over input from STDIN.
[--stdin]
Read structured JSON from STDIN.
[--porcelain]
Output just the new post ids.
示例
# Create a post and duplicate it to all languages
$ wp pll post create --post_type=page --post_title="Blog" --post_status=publish
Success: Created and linked 2 posts of the page post type.
# Create a post and its translations using structured JSON
$ echo '{"nl":{"post_title":"Dutch title","post_content":"Dutch content"},"de":{"post_title":"German title","post_content":"German content"}}' | wp pll post create --post_type=post --stdin
Success: Created and linked 2 posts of the post post type.
wp pll post get
列出文章及其翻译,或获取某种语言的文章。
wp pll post get <post_id> [<language-code>] [--api]
选项
<post_id>
Post ID of the post to get. Required.
[<language-code>]
The language code (slug) to get the post ID for, when using the --api flag. Optional.
[--api]
Use the Polylang API function pll_get_post()
示例
wp pll post get 12
wp pll post get 1 es --api
wp pll post update
更新一个或多个现有文章及其翻译。
wp pll post update <id>... [<file>] --<field>=<value> [--defer-term-counting]
选项
<id>...
One or more IDs of posts to update.
[<file>]
Read post content from <file>. If this value is present, the
`--post_content` argument will be ignored.
传递-
作为文件名将导致文章内容从STDIN读取。
--<field>=<value>
One or more fields to update. See wp_update_post().
[--defer-term-counting]
Recalculate term count in batch, for a performance boost.
示例
$ wp pll post update 13 --comment_status=closed
Success: Updated post 13.
wp pll post delete
删除文章及其翻译。
wp pll post delete <post_id> [--force] [--defer-term-counting]
选项
<post_id>
Post ID of the a translated post to delete. Required.
[--force]
Skip the trash bin.
[--defer-term-counting]
Recalculate term count in batch, for a performance boost.
示例
wp pll post delete 32
wp pll post duplicate
将文章复制到一种或多种语言。
wp pll post duplicate <post_id> [<language-code>]
根据Polylang设置同步元数据和分类法术语。运行wp pll option list
来检查当前设置。
选项
<post_id>
Post ID of the post to duplicate. Required.
[<language-code>]
Language code (slug), or comma-separated list of language codes, to duplicate the post to. Omit to duplicate to all languages. Optional.
示例
# Duplicate post 23 (Dutch) to German
$ wp pll post duplicate 23 de
Success: Created post 68 (de) < post 23 (nl)
# Duplicate post 23 (Dutch) to all languages (German and Spanish)
$ wp pll post duplicate 23
Success: Updated post 68 (de) < post 23 (nl)
Success: Created post 69 (es) < post 23 (nl)
wp pll post list
获取某种语言中的文章列表。
wp pll post list <language-code> [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
注意:与Polylang一样,此命令将lang
参数传递给WP_Query,即wp post list --lang=<language-code>
。
选项
<language-code>
The language code (slug) to get the post count for. Required.
[--<field>=<value>]
One or more args to pass to WP_Query.
[--field=<field>]
Prints the value of a single field for each post.
[--fields=<fields>]
Limit the output to specific object fields.
[--format=<format>]
Render output in a particular format.
---
default: table
options:
- table
- csv
- ids
- json
- count
- yaml
---
可用的字段
这些字段将默认显示在每个文章中
- ID
- post_title
- post_name
- post_date
- post_status
这些字段是可选的
- post_author
- post_date_gmt
- post_content
- post_excerpt
- comment_status
- ping_status
- post_password
- to_ping
- pinged
- post_modified
- post_modified_gmt
- post_content_filtered
- post_parent
- guid
- menu_order
- post_type
- post_mime_type
- comment_count
- filter
- url
示例
wp pll post list nl
# List post
$ wp pll post list es --field=ID
568
829
1329
1695
# List posts in JSON
$ wp pll post list en-gb --post_type=post --posts_per_page=5 --format=json
[{"ID":1,"post_title":"Hello world!","post_name":"hello-world","post_date":"2015-06-20 09:00:10","post_status":"publish"},{"ID":1178,"post_title":"Markup: HTML Tags and Formatting","post_name":"markup-html-tags-and-formatting","post_date":"2013-01-11 20:22:19","post_status":"draft"}]
# List all pages
$ wp pll post list nl --post_type=page --fields=post_title,post_status
+-------------+-------------+
| post_title | post_status |
+-------------+-------------+
| Sample Page | publish |
+-------------+-------------+
# List ids of all pages and posts
$ wp pll post list es --post_type=page,post --format=ids
15 25 34 37 198
# List given posts
$ wp pll post list nl --post__in=1,3
+----+--------------+-------------+---------------------+-------------+
| ID | post_title | post_name | post_date | post_status |
+----+--------------+-------------+---------------------+-------------+
| 1 | Hello world! | hello-world | 2016-06-01 14:31:12 | publish |
+----+--------------+-------------+---------------------+-------------+
wp pll post-type
检查和管理WordPress文章类型及其翻译状态。
wp pll post-type
wp pll post-type disable
禁用文章类型的翻译。
wp pll post-type disable <post_types>
选项
<post_types>
One or a comma-separated list of post types to disable translation for.
示例
wp pll post-type disable book
wp pll post-type enable
启用文章类型的翻译。
wp pll post-type enable <post_types>
选项
<post_types>
One or a comma-separated list of post types to enable translation for.
示例
wp pll post-type enable book
wp pll post-type list
列出具有其翻译状态的文章类型。
wp pll post-type list
示例
wp pll post-type list
wp pll plugin uninstall
卸载Polylang并可选地删除所有数据。
wp pll plugin uninstall [--force] [--skip-delete]
选项
[--force]
Ignores the Polylang `uninstall` setting and force deletes all data.
[--skip-delete]
If set, the plugin files will not be deleted. Only the uninstall procedure
will be run.
示例
$ wp pll uninstall
$ wp pll uninstall --force
$ wp pll uninstall --force --skip-delete
wp pll string
检查和管理Polylang字符串翻译。
wp pll string
wp pll string list
列出字符串翻译。
wp pll string list [<language-code>] [--fields=<value>] [--format=<format>] [--s=<value>] [--orderby=<value>] [--order=<value>]
选项
[<language-code>]
The language code (slug) to get the string translations for. Optional.
[--fields=<value>]
Limit the output to specific object fields. Valid values are: name, string, context, multiline, translations, row.
[--format=<format>]
Accepted values: table, csv, json, count, yaml. Default: table
[--s=<value>]
Search for a string in `name` and `string` fields.
[--orderby=<value>]
Define which column to sort.
[--order=<value>]
Define the order of the results, asc or desc.
示例
$ wp pll string list --s="WordPress site"
$ wp pll string list --order=asc --orderby=string
$ wp pll string list de --fields=string,translations
$ wp pll string list es --format=csv
wp pll taxonomy
检查和管理WordPress分类法及其翻译状态。
wp pll taxonomy
wp pll taxonomy disable
禁用分类法的翻译。
wp pll taxonomy disable <taxonomies>
选项
<taxonomies>
Taxonomy or comma-separated list of taxonomies to disable translation for.
示例
wp pll taxonomy disable genre
wp pll taxonomy enable
启用分类法的翻译。
wp pll taxonomy enable <taxonomies>
选项
<taxonomies>
Taxonomy or comma-separated list of taxonomies to enable translation for.
示例
wp pll taxonomy enable genre
wp pll taxonomy list
列出具有其翻译状态的分类法。
wp pll taxonomy list [--format=<format>]
选项
[--format=<format>]
Render output in a particular format.
---
default: table
options:
- table
- csv
- ids
- json
- count
- yaml
---
示例
wp pll taxonomy list
wp pll term
检查和管理WordPress分类法术语及其翻译。
wp pll term
wp pll term get
获取翻译术语的详细信息。
wp pll term get <taxonomy> <term-id> [--field=<field>] [--fields=<fields>] [--format=<format>] [--api]
选项
<taxonomy>
Taxonomy of the term to get
<term-id>
ID of the term to get
[--field=<field>]
Instead of returning the whole term, returns the value of a single field.
[--fields=<fields>]
Limit the output to specific fields. Defaults to all fields.
[--format=<format>]
Render output in a particular format.
---
default: table
options:
- table
- csv
- json
- yaml
---
[--api]
Use the Polylang API function pll_get_term_translations()
示例
# Get details about a category with term ID 18.
$ wp pll term get category 18
wp pll term duplicate
将分类法术语复制到一种或多种语言。
wp pll term duplicate <taxonomy> <term-id> [<language-code>]
选项
<taxonomy>
Taxonomy of the term to duplicate
<term-id>
ID of the term to duplicate
[<language-code>]
Language code (slug), or comma-separated list of language codes, to duplicate the term to. Omit to duplicate to all languages. Optional.
示例
# Duplicate term 18 of the category taxonomy to all other languages.
$ wp pll term duplicate category 18
wp pll term delete
删除现有的分类法术语及其翻译。
wp pll term delete <taxonomy> <term-id>...
如果术语不存在或删除时出现问题,将出现错误。
选项
<taxonomy>
Taxonomy of the term to delete.
<term-id>...
One or more IDs of terms to delete.
示例
# Delete a term (English) and its translations (Spanish, French)
$ wp pll term delete post_tag 56
Deleted post_tag 56.
Deleted post_tag 57.
Deleted post_tag 58.
Success: Deleted 3 of 3 terms.
wp pll术语列表
获取一个语言的术语列表。
wp pll term list <taxonomy> <language-code> [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
选项
<taxonomy>
List terms of one or more taxonomies. Required.
<language-code>
The language code (slug) to get the taxonomy terms for. Required.
[--<field>=<value>]
Filter by one or more fields (see get_terms() $args parameter for a list of fields).
[--field=<field>]
Prints the value of a single field for each term.
[--fields=<fields>]
Limit the output to specific object fields.
[--format=<format>]
Render output in a particular format.
---
default: table
options:
- table
- csv
- ids
- json
- count
- yaml
---
可用的字段
以下字段将默认显示每个术语
- term_id
- term_taxonomy_id
- name
- slug
- description
- parent
- count
这些字段是可选的
- url
示例
# List post categories
$ wp pll term list color nl --format=csv
term_id,term_taxonomy_id,name,slug,description,parent,count
2,2,Rood,rood,,0,1
3,3,Blauw,blauw,,0,1
# List post tags
$ wp pll term list post_tag en --fields=name,slug
+-----------+-------------+
| name | slug |
+-----------+-------------+
| Articles | articles |
| aside | aside |
+-----------+-------------+
wp pll术语生成
生成一些术语及其翻译。
wp pll term generate <taxonomy> [--count=<number>] [--max_depth=<number>] [--format=<format>]
使用虚拟数据创建指定数量的新术语及其翻译集合。
选项
<taxonomy>
The taxonomy for the generated terms.
[--count=<number>]
How many sets of terms to generate?
---
default: 5
---
[--max_depth=<number>]
Generate child terms down to a certain depth.
---
default: 1
---
[--format=<format>]
Render output in a particular format.
---
default: table
options:
- table
- csv
- json
- yaml
- ids
---
示例
# Generate some post categories, and translations.
$ wp pll term generate category --count=3 --format=ids
115 116 117 118 119 120
贡献
我们感谢您主动为这个项目做出贡献。
贡献不仅仅局限于代码。我们鼓励您以最适合您能力的方式贡献,例如撰写教程、在当地聚会中演示、帮助其他用户解答支持问题或修订我们的文档。
为了更深入的了解,请查看WP-CLI贡献指南。本软件包遵循那些政策和指南。
报告错误
认为您找到了错误?我们很乐意您帮助我们修复它。
在创建新问题之前,您应该搜索现有问题,以查看是否有对该错误的现有解决方案,或者它是否已在较新版本中修复。
一旦您进行了一些搜索并发现没有针对您的错误打开或已修复的问题,请创建一个新问题。尽可能提供详细信息,并尽可能提供清晰的复现步骤。有关更多指导,请查看我们的错误报告文档。
创建pull请求
想要贡献一个新功能?请首先创建一个新问题来讨论该功能是否适合项目。
一旦您决定投入时间完成您的pull请求,请遵循我们创建pull请求的指南,以确保它是一个愉快的体验。有关在本地处理此软件包的详细信息,请参阅"设置"。
开发
Behat测试
要运行polylang-cli的Behat测试,请cd
到软件包目录,并在命令行中运行$ ./vendor/bin/behat --expand
。要运行特定测试组,请使用tags
参数;例如:$ ./vendor/bin/behat --expand --tags @pll-lang
此README.md是从项目的代码库动态生成的,使用wp scaffold package-readme
(文档)。要建议更改,请提交针对代码库相应部分的pull请求。