wp network

Perform network-wide operations.

Subcommands

Command Description
wp network meta Gets, adds, updates, deletes, and lists network custom fields.

wp network meta

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

Subcommands

Command Description
wp network meta add Add a meta field.
wp network meta delete Delete a meta field.
wp network meta get Get meta field value.
wp network meta list List all metadata associated with an object.
wp network meta patch Update a nested value for a meta field.
wp network meta pluck Get a nested value from a meta field.
wp network meta update Update a meta field.

wp network meta add

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

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

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

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

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

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

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

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