entity-command icon indicating copy to clipboard operation
entity-command copied to clipboard

Allow fetching raw option value for JSON encoded / PHP serialized options

Open johnbillion opened this issue 7 years ago • 3 comments

When calling wp option list, the option values are displayed in their raw format.

When calling wp option get <key>, there's no way to get the raw value for a JSON encoded or PHP serialized value.

johnbillion avatar Apr 07 '18 11:04 johnbillion

@johnbillion Just to clarify, this would be the value in the database?

While wp option get could support --format=raw, is there syntax you'd suggest for wp option list?

danielbachhuber avatar Apr 10 '18 15:04 danielbachhuber

wp option list always shows the raw value for options. It could be extended to support the full list of formats (JSON, CSV, etc) but I'm not sure how useful that is.

johnbillion avatar Apr 10 '18 15:04 johnbillion

Added the --format=raw to the wp option get command in the PR above.

The wp option list already has a formatter supporting:

  - table
  - json
  - csv
  - count
  - yaml
  - total_bytes

which I assume was added after this ticket was created.

shawnhooper avatar Nov 15 '23 21:11 shawnhooper

Marking this as a wontfix based on the discussion at #446

swissspidy avatar May 07 '24 19:05 swissspidy