wp network

Perform network-wide operations.

Subcommands

CommandDescription
wp network metaGets, adds, updates, deletes, and lists network custom fields.

wp network meta

Gets, adds, updates, deletes, and lists network custom fields.

Subcommands

CommandDescription
wp network meta addAdd a meta field.
wp network meta deleteDelete a meta field.
wp network meta getGet meta field value.
wp network meta listList all metadata associated with an object.
wp network meta patchUpdate a nested value for a meta field.
wp network meta pluckGet a nested value from a meta field.
wp network meta updateUpdate a meta field.

wp network meta add

bash
wp network meta add <id> <key> [<value>] [--format=<format>]

Options:

<id> – The ID of the object.
<key> – The name of the meta field to create.
[<value>] – The value of the meta field. If omitted, the value is read from STDIN.
[--format=<format>] – The serialization format for the value (plaintext, json).

wp network meta delete

bash
wp network meta delete <id> [<key>] [<value>] [--all]

Options:

<id> – The ID of the object.
[<key>] – The name of the meta field to delete.
[<value>] – The value to delete. If omitted, all rows with key will deleted.
[--all] – Delete all meta for the object.

wp network meta get

bash
wp network meta get <id> <key> [--single] [--format=<format>]

Options:

<id> – The ID of the object.
<key> – The name of the meta field to get.
[--single] – Whether to return a single value.
[--format=<format>] – Get value in a particular format (var_export, json, yaml).

wp network meta list

bash
wp network meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>] [--orderby=<fields>] [--order=<order>] [--unserialize]

Options:

<id> – ID for the object.
[--keys=<keys>] – Limit output to metadata of specific keys.
[--fields=<fields>] – Limit the output to specific row fields. Defaults to id,meta_key,meta_value.
[--format=<format>] – Render output in a particular format (table, csv, json, yaml, count).
[--orderby=<fields>] – Set orderby which field (id, meta_key, meta_value).
[--order=<order>] – Set ascending or descending order (asc, desc).
[--unserialize] – Unserialize meta_value output.

wp network meta patch

bash
wp network meta patch <action> <id> <key> <key-path>... [<value>] [--format=<format>]

Options:

<action> – Patch action to perform (insert, update, delete).
<id> – The ID of the object.
<key> – The name of the meta field to update.
<key-path>... – The name(s) of the keys within the value to locate the value to patch.
[<value>] – The new value. If omitted, the value is read from STDIN.
[--format=<format>] – The serialization format for the value (plaintext, json).

wp network meta pluck

bash
wp network meta pluck <id> <key> <key-path>... [--format=<format>]

Options:

<id> – The ID of the object.
<key> – The name of the meta field to get.
<key-path>... – The name(s) of the keys within the value to locate the value to pluck.
[--format=<format>] – The output format of the value (plaintext, json, yaml).

wp network meta update

bash
wp network meta update <id> <key> [<value>] [--format=<format>]

Options:

<id> – The ID of the object.
<key> – The name of the meta field to update.
[<value>] – The new value. If omitted, the value is read from STDIN.
[--format=<format>] – The serialization format for the value (plaintext, json).

Examples

bash
# Get a list of super-admins
$ wp network meta get 1 site_admins
array (
  0 => 'supervisor',
)