Skip to content

Support non unique meta_keys when getting values #325

@grappler

Description

@grappler

Feature Request

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:

$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

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions