2017 © Pedro Peláez
 

wp-cli-package polylang-cli

CLI for the Polylang plugin

image

diggy/polylang-cli

CLI for the Polylang plugin

  • Thursday, February 15, 2018
  • by diggy
  • Repository
  • 3 Watchers
  • 12 Stars
  • 836 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 7 Open issues
  • 6 Versions
  • 19 % Grown

The README.md

diggy/polylang-cli

CLI for the Polylang plugin, (*1)

Build Status, (*2)

Quick links: Installation | Using | Contributing | Development, (*3)

Installation

Installing this package requires WP-CLI v1.5.0 or greater. Update to the latest stable release with wp cli update. Once you've done so, you can install this package with wp package install git@github.com:diggy/polylang-cli.git., (*4)

Using

This package implements the following commands:, (*5)

wp pll api

Inspect Polylang procedural API functions., (*6)

wp pll api

wp pll api list

List Polylang procedural API functions., (*7)

wp pll api list [--format=<format>]

OPTIONS, (*8)

[--format=<format>]
    Accepted values: table, csv, json, count, yaml. Default: table

EXAMPLES, (*9)

$ wp pll api list
$ wp pll api list --format=csv

wp pll cache

Inspect and manage Polylang languages cache., (*10)

wp pll cache

wp pll cache clear

Clears the Polylang languages cache., (*11)

wp pll cache clear

EXAMPLES, (*12)

$ wp pll cache clear
Success: Languages cache cleared.

$ wp pll cache clear --quiet

wp pll cache get

Gets the Polylang languages cache., (*13)

wp pll cache get [--format=<format>]

OPTIONS, (*14)

[--format=<format>]
    Accepted values: table, csv, json, count, yaml. Default: table

EXAMPLES, (*15)

$ 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

Troubleshoot Polylang., (*16)

wp pll doctor

wp pll doctor check

List untranslated post and term objects (translatable)., (*17)

wp pll doctor check [--format=<format>]

OPTIONS, (*18)

[--format=<format>]
    Render output in a particular format.
    ---
    default: table
    options:
      - table
      - csv
      - json
      - count
      - yaml
    ---

EXAMPLES, (*19)

wp pll doctor check

wp pll doctor language

Mass install, update and prune core, theme and plugin language files., (*20)

wp pll doctor language

EXAMPLES, (*21)

$ wp pll doctor language

wp pll doctor recount

Recalculate number of posts assigned to each language taxonomy term., (*22)

wp pll doctor recount

In instances where manual updates are made to the terms assigned to posts in the database, the number of posts associated with a term can become out-of-sync with the actual number of posts., (*23)

This command runs wp_update_term_count() on the language taxonomy's terms to bring the count back to the correct value., (*24)

EXAMPLES, (*25)

wp pll doctor recount

wp pll doctor translate

Translate untranslated posts and taxonomies in bulk., (*26)

wp pll doctor translate

EXAMPLES, (*27)

wp pll doctor translate

wp pll flag

Inspect and manage Polylang country flags., (*28)

wp pll flag

wp pll flag list

List Polylang country flags., (*29)

wp pll flag list [--format=<format>]

OPTIONS, (*30)

[--format=<format>]
    Accepted values: table, csv, json, count, yaml. Default: table

EXAMPLES, (*31)

$ wp pll flag list
$ wp pll flag list --format=csv

wp pll flag set

Set Polylang country flag for language., (*32)

wp pll flag set <language-code> <flag-code>

Run wp pll flag list to get a list of valid flag values. Pass an empty string as second parameter to delete the flag value., (*33)

OPTIONS, (*34)

<language-code>
    Language code (slug) for the language to update. Required.

<flag-code>
    Valid flag code for the language to update. Required.

EXAMPLES, (*35)

# set flag for Dutch language
$ wp pll flag set nl nl

# delete flag for Dutch language
$ wp pll flag set nl ""

wp pll lang

Manage Polylang language taxonomy and taxonomy terms., (*36)

wp pll lang

wp pll lang create

Create a language., (*37)

wp pll lang create <name> <language-code> <locale> [--rtl=<bool>] [--order=<int>] [--flag=<string>] [--no_default_cat=<bool>]

OPTIONS, (*38)

<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.

EXAMPLES, (*39)

$ 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

Delete one, some or all languages., (*40)

wp pll lang delete [<language-code>] [--all] [--keep_default]

Deletes Polylang languages and uninstalls core language packs if not in use by other languages., (*41)

OPTIONS, (*42)

[<language-code>]
    Comma-separated slugs of the languages to delete.

[--all]
    Delete all languages

[--keep_default]
    Whether to keep the default language.

EXAMPLES, (*43)

# 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

Generate some languages., (*44)

wp pll lang generate [--count=<number>]

OPTIONS, (*45)

[--count=<number>]
    How many languages to generate. Default: 10

EXAMPLES, (*46)

wp pll lang generate --count=25

wp pll lang get

Get a language., (*47)

wp pll lang get <language-code> [--field=<field>] [--fields=<fields>] [--format=<format>]

OPTIONS, (*48)

<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

EXAMPLES, (*49)

wp pll lang get en --format=json

wp pll lang list

List installed languages., (*50)

wp pll lang list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>] [--pll=<value>]

List installed languages as Polylang objects. Passing --pll=0 will output the result of wp term list language, (*51)

OPTIONS, (*52)

[--<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.

AVAILABLE FIELDS (POLYLANG OBJECT), (*53)

These fields will be displayed by default for each term:, (*54)

  • 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

AVAILABLE FIELDS (WP TERM OBJECT), (*55)

These fields will be displayed by default for each term:, (*56)

  • term_id
  • term_taxonomy_id
  • name
  • slug
  • description
  • parent
  • count

There are no optionally available fields., (*57)

EXAMPLES, (*58)

# 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

Update a language., (*59)

wp pll lang update <language-code> [--name=<name>] [--slug=<slug>] [--locale=<locale>] [--rtl=<bool>] [--order=<int>] [--flag=<string>]

OPTIONS, (*60)

<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.

EXAMPLES, (*61)

wp pll lang update en --name=English --order=15

wp pll lang url

Get the URL for a language., (*62)

wp pll lang url <language-code>

OPTIONS, (*63)

<language-code>
    The language code (slug) to get the URL for. Required.

EXAMPLES, (*64)

wp pll lang url en
wp pll lang url es

wp pll menu

Manage the WP Nav Menus., (*65)

wp pll menu

wp pll menu create

Create a new menu for each language, AND assign it to a location., (*66)

wp pll menu create <menu-name> <location> [--porcelain]

OPTIONS, (*67)

<menu-name>
    A descriptive name for the menu.

<location>
    Location’s slug.

[--porcelain]
    Output just the new menu ids.

EXAMPLES, (*68)

$ 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

Inspect and manage Polylang settings., (*69)

wp pll option

wp pll option default

Gets or sets the default language., (*70)

wp pll option default [<language-code>]

OPTIONS, (*71)

[<language-code>]
    Optional. The language code (slug) to set as default.

EXAMPLES, (*72)

$ wp pll option default
$ wp pll option default nl

wp pll option get

Get Polylang settings., (*73)

wp pll option get <option_name> [--format=<format>]

OPTIONS, (*74)

<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
    ---

EXAMPLES, (*75)

$ wp pll option get default_lang

wp pll option list

List Polylang settings., (*76)

wp pll option list [--format=<format>]

OPTIONS, (*77)

[--format=<format>]
    Accepted values: table, csv, json, count, yaml. Default: table

EXAMPLES, (*78)

$ wp pll option list
$ wp pll option list --format=csv

wp pll option reset

Reset Polylang settings., (*79)

wp pll option reset

EXAMPLES, (*80)

$ wp pll option reset

wp pll option sync

Enable post meta syncing across languages., (*81)

wp pll option sync <item>

Accepted values:, (*82)

  • taxonomies
  • post_meta
  • comment_status
  • ping_status
  • sticky_posts
  • post_date
  • post_format
  • post_parent
  • _wp_page_template
  • menu_order
  • _thumbnail_id

OPTIONS, (*83)

<item>
    Item, or comma-separated list of items, to sync. Required.

EXAMPLES, (*84)

$ wp pll option sync taxonomies,post_meta
Success: Polylang `sync` option updated.

wp pll option unsync

Disable post meta syncing across languages., (*85)

wp pll option unsync <item>

Accepted values:, (*86)

  • taxonomies
  • post_meta
  • comment_status
  • ping_status
  • sticky_posts
  • post_date
  • post_format
  • post_parent
  • _wp_page_template
  • menu_order
  • _thumbnail_id

OPTIONS, (*87)

<item>
    Item, or comma-separated list of items, to unsync. Required.

EXAMPLES, (*88)

$ wp pll option unsync post_format,_wp_page_template
Success: Polylang `sync` option updated.

wp pll option update

Update Polylang settings., (*89)

wp pll option update <option_name> <new_value>

OPTIONS, (*90)

<option_name>
    Option name. Use the options subcommand to get a list of accepted values. Required.

<new_value>
    New value for the option. Required.

EXAMPLES, (*91)

$ wp pll option update default_lang nl

wp pll post

Manage posts and their translations., (*92)

wp pll post

wp pll post count

Count posts for a language., (*93)

wp pll post count <language-code> [--post_type=<post_type>]

OPTIONS, (*94)

<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.

EXAMPLES, (*95)

wp pll post count nl
wp pll post count es --post_type=page

wp pll post generate

Generate some posts and their translations., (*96)

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>]

Creates a specified number of sets of new posts with dummy data., (*97)

OPTIONS, (*98)

[--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
    ---

EXAMPLES, (*99)

# 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

Create a new post and its translations., (*100)

wp pll post create --post_type=<type> [--<field>=<value>] [--stdin] [--porcelain]

OPTIONS, (*101)

--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.

EXAMPLES, (*102)

# 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

List a post and its translations, or get a post for a language., (*103)

wp pll post get <post_id> [<language-code>] [--api]

OPTIONS, (*104)

<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()

EXAMPLES, (*105)

wp pll post get 12
wp pll post get 1 es --api

wp pll post update

Update one or more existing posts and their translations., (*106)

wp pll post update <id>... [<file>] --<field>=<value> [--defer-term-counting]

OPTIONS, (*107)

<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.

Passing - as the filename will cause post content to be read from STDIN., (*108)

--<field>=<value>
    One or more fields to update. See wp_update_post().

[--defer-term-counting]
    Recalculate term count in batch, for a performance boost.

EXAMPLES, (*109)

$ wp pll post update 13 --comment_status=closed
Success: Updated post 13.

wp pll post delete

Delete a post and its translations., (*110)

wp pll post delete <post_id> [--force] [--defer-term-counting]

OPTIONS, (*111)

<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.

EXAMPLES, (*112)

wp pll post delete 32

wp pll post duplicate

Duplicate a post to one or more languages., (*113)

wp pll post duplicate <post_id> [<language-code>]

Syncs metadata and taxonomy terms, based on Polylang settings. Run wp pll option list to inspect current settings., (*114)

OPTIONS, (*115)

<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.

EXAMPLES, (*116)

# 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

Get a list of posts in a language., (*117)

wp pll post list <language-code> [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]

NB: Like Polylang, this command passes a lang parameter to WP_Query, i.e. wp post list --lang=<language-code>., (*118)

OPTIONS, (*119)

<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
    ---

AVAILABLE FIELDS, (*120)

These fields will be displayed by default for each post:, (*121)

  • ID
  • post_title
  • post_name
  • post_date
  • post_status

These fields are optionally available:, (*122)

  • 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

EXAMPLES, (*123)

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

Inspect and manage WordPress post types and their translation status., (*124)

wp pll post-type

wp pll post-type disable

Disable translation for post types., (*125)

wp pll post-type disable <post_types>

OPTIONS, (*126)

<post_types>
    One or a comma-separated list of post types to disable translation for.

EXAMPLES, (*127)

wp pll post-type disable book

wp pll post-type enable

Enable translation for post types., (*128)

wp pll post-type enable <post_types>

OPTIONS, (*129)

<post_types>
    One or a comma-separated list of post types to enable translation for.

EXAMPLES, (*130)

wp pll post-type enable book

wp pll post-type list

List post types with their translation status., (*131)

wp pll post-type list

EXAMPLES, (*132)

wp pll post-type list

wp pll plugin uninstall

Uninstall Polylang and optionally remove all data., (*133)

wp pll plugin uninstall [--force] [--skip-delete]

OPTIONS, (*134)

[--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.

EXAMPLES, (*135)

$ wp pll uninstall
$ wp pll uninstall --force
$ wp pll uninstall --force --skip-delete

wp pll string

Inspect and manage Polylang string translations., (*136)

wp pll string

wp pll string list

List string translations., (*137)

wp pll string list [<language-code>] [--fields=<value>] [--format=<format>] [--s=<value>] [--orderby=<value>] [--order=<value>]

OPTIONS, (*138)

[<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.

EXAMPLES, (*139)

$ 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

Inspect and manage WordPress taxonomies and their translation status., (*140)

wp pll taxonomy

wp pll taxonomy disable

Disable translation for taxonomies., (*141)

wp pll taxonomy disable <taxonomies>

OPTIONS, (*142)

<taxonomies>
    Taxonomy or comma-separated list of taxonomies to disable translation for.

EXAMPLES, (*143)

wp pll taxonomy disable genre

wp pll taxonomy enable

Enable translation for taxonomies., (*144)

wp pll taxonomy enable <taxonomies>

OPTIONS, (*145)

<taxonomies>
    Taxonomy or comma-separated list of taxonomies to enable translation for.

EXAMPLES, (*146)

wp pll taxonomy enable genre

wp pll taxonomy list

List taxonomies with their translation status., (*147)

wp pll taxonomy list [--format=<format>]

OPTIONS, (*148)

[--format=<format>]
    Render output in a particular format.
    ---
    default: table
    options:
      - table
      - csv
      - ids
      - json
      - count
      - yaml
    ---

EXAMPLES, (*149)

wp pll taxonomy list

wp pll term

Inspect and manage WordPress taxonomy terms and their translations., (*150)

wp pll term

wp pll term get

Get details about a translated term., (*151)

wp pll term get <taxonomy> <term-id> [--field=<field>] [--fields=<fields>] [--format=<format>] [--api]

OPTIONS, (*152)

<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()

EXAMPLES, (*153)

# Get details about a category with term ID 18.
$ wp pll term get category 18

wp pll term duplicate

Duplicate a taxonomy term to one or more languages., (*154)

wp pll term duplicate <taxonomy> <term-id> [<language-code>]

OPTIONS, (*155)

<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.

EXAMPLES, (*156)

# Duplicate term 18 of the category taxonomy to all other languages.
$ wp pll term duplicate category 18

wp pll term delete

Delete an existing taxonomy term and its translations., (*157)

wp pll term delete <taxonomy> <term-id>...

Errors if the term doesn't exist, or there was a problem in deleting it., (*158)

OPTIONS, (*159)

<taxonomy>
    Taxonomy of the term to delete.

<term-id>...
    One or more IDs of terms to delete.

EXAMPLES, (*160)

# 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 term list

Get a list of taxonomy terms for a language., (*161)

wp pll term list <taxonomy> <language-code> [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]

OPTIONS, (*162)

<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
    ---

AVAILABLE FIELDS, (*163)

These fields will be displayed by default for each term:, (*164)

  • term_id
  • term_taxonomy_id
  • name
  • slug
  • description
  • parent
  • count

These fields are optionally available:, (*165)

  • url

EXAMPLES, (*166)

# 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 term generate

Generate some taxonomy terms and their translations., (*167)

wp pll term generate <taxonomy> [--count=<number>] [--max_depth=<number>] [--format=<format>]

Creates a specified number of sets of new terms and their translations with dummy data., (*168)

OPTIONS, (*169)

<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
    ---

EXAMPLES, (*170)

# Generate some post categories, and translations.
$ wp pll term generate category --count=3 --format=ids
115 116 117 118 119 120

Contributing

We appreciate you taking the initiative to contribute to this project., (*171)

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation., (*172)

For a more thorough introduction, check out WP-CLI's guide to contributing. This package follows those policy and guidelines., (*173)

Reporting a bug

Think you’ve found a bug? We’d love for you to help us get it fixed., (*174)

Before you create a new issue, you should search existing issues to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version., (*175)

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please create a new issue. Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, review our bug report documentation., (*176)

Creating a pull request

Want to contribute a new feature? Please first open a new issue to discuss whether the feature is a good fit for the project., (*177)

Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience. See "Setting up" for details specific to working on this package locally., (*178)

Development

Behat Tests

To run the Behat tests for polylang-cli, cd into the package directory and run $ ./vendor/bin/behat --expand from the command line. To run a specific group of tests use the tags parameter; e.g.: $ ./vendor/bin/behat --expand --tags @pll-lang, (*179)

This README.md is generated dynamically from the project's codebase using wp scaffold package-readme (doc). To suggest changes, please submit a pull request against the corresponding part of the codebase., (*180)

The Versions

15/02 2018

dev-master

9999999-dev https://github.com/diggy/polylang-cli

CLI for the Polylang plugin

  Sources   Download

MIT

The Requires

 

The Development Requires

15/02 2018

v1.0.0-alpha.1

1.0.0.0-alpha1 https://github.com/diggy/polylang-cli

CLI for the Polylang plugin

  Sources   Download

MIT

The Requires

 

The Development Requires

15/02 2018

dev-update-readme-1-5-0

dev-update-readme-1-5-0 https://github.com/diggy/polylang-cli

CLI for the Polylang plugin

  Sources   Download

MIT

The Requires

 

The Development Requires

15/02 2018

dev-wp-cli-1-5-0

dev-wp-cli-1-5-0 https://github.com/diggy/polylang-cli

CLI for the Polylang plugin

  Sources   Download

MIT

The Requires

 

The Development Requires

11/06 2017

dev-add-wp-pll-widget-list-subcommand

dev-add-wp-pll-widget-list-subcommand https://github.com/diggy/polylang-cli

CLI for the Polylang plugin

  Sources   Download

MIT

The Requires

 

The Development Requires

28/02 2017

dev-add-`wp-pll-post-create`-command

dev-add-`wp-pll-post-create`-command https://github.com/diggy/polylang-cli

CLI interface for the Polylang plugin

  Sources   Download

MIT

The Requires

 

The Development Requires