-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
command:post-metaRelated to 'post meta' commandRelated to 'post meta' commandcommand:post-meta-getRelated to 'post meta get' commandRelated to 'post meta get' commandcommand:term-metaRelated to 'term meta' commandRelated to 'term meta' commandcommand:term-meta-getRelated to 'term meta get' commandRelated to 'term meta get' commandcommand:user-metaRelated to 'user meta' commandRelated to 'user meta' commandcommand:user-meta-getRelated to 'user meta get' commandRelated to 'user meta get' command
Description
Feature Request
- Yes, I reviewed the contribution guidelines.
Describe your use case and the problem you are facing
Post meta can either be unique or non single. This means that the same meta key can be used multiple times in post meta. When using get_post_meta() you can pass if the meta key is single or not.
Unfortunately wp post meta 1 meta_key does not support this. At the moment only the first value is returned.
Describe the solution you'd like
This is caused by the fixed defined parameter in the code:
entity-command/src/WP_CLI/CommandWithMeta.php
Line 161 in 6e0e77a
| $value = $this->get_metadata( $object_id, $meta_key, true ); |
It would be nice if the third parameter could be either set using the arguments or using a flag. Either
wp post meta 1 meta_key false or wp post meta 1 meta_key --is-single=false.
Metadata
Metadata
Assignees
Labels
command:post-metaRelated to 'post meta' commandRelated to 'post meta' commandcommand:post-meta-getRelated to 'post meta get' commandRelated to 'post meta get' commandcommand:term-metaRelated to 'term meta' commandRelated to 'term meta' commandcommand:term-meta-getRelated to 'term meta get' commandRelated to 'term meta get' commandcommand:user-metaRelated to 'user meta' commandRelated to 'user meta' commandcommand:user-meta-getRelated to 'user meta get' commandRelated to 'user meta get' command