buddypress / wp-cli-buddypress

WP-CLI Community Package of BuddyPress commands
GNU General Public License v3.0
47 stars 19 forks source link

Metadata commands #74

Closed boonebgorges closed 4 years ago

boonebgorges commented 5 years ago

Would be great to have metadata commands: wp bp group meta update etc.

renatonascalves commented 4 years ago

@boonebgorges I'm considering working on this feature. Is the meta update the only command to add?

Also, could you share what types of meta one would usually update? Don't want to overboard.

boonebgorges commented 4 years ago

It would be nice to mirror WP-CLI's meta commands:

$ wp post meta
usage: wp post meta add <id> <key> [<value>] [--format=<format>]
   or: wp post meta delete <id> [<key>] [<value>] [--all]
   or: wp post meta get <id> <key> [--format=<format>]
   or: wp post meta list <id> [--keys=<keys>] [--fields=<fields>] [--format=<format>] [--orderby=<fields>] [--order=<order>]
   or: wp post meta patch <action> <id> <key> <key-path>... [<value>] [--format=<format>]
   or: wp post meta pluck <id> <key> <key-path>... [--format=<format>]
   or: wp post meta update <id> <key> [<value>] [--format=<format>]

I wonder if there's a way we can extend CommandWithMeta. See wp comment meta https://github.com/wp-cli/entity-command/blob/master/src/Comment_Meta_Command.php and the base class https://github.com/wp-cli/entity-command/blob/master/src/WP_CLI/CommandWithMeta.php

renatonascalves commented 4 years ago

Interesting! Will take a look soon!

renatonascalves commented 4 years ago

Closing this since this command is being added and documented on #76