Abstract meta CRUD into methods#174
Abstract meta CRUD into methods#174schlessera merged 8 commits intowp-cli:masterfrom spacedmonkey:functions-meta
Conversation
src/WP_CLI/CommandWithMeta.php
Outdated
| @@ -1,4 +1,4 @@ | |||
| <?php | |||
| $this->update_metadata( <?php | |||
There was a problem hiding this comment.
There's nonsense up here... ;)
src/Comment_Meta_Command.php
Outdated
| class Comment_Meta_Command extends \WP_CLI\CommandWithMeta { | ||
| protected $meta_type = 'comment'; | ||
|
|
||
|
|
There was a problem hiding this comment.
This should only have 1 blank line here.
src/Term_Meta_Command.php
Outdated
| protected function delete_metadata( $object_id, $meta_key, $meta_value = '', $delete_all = false ) { | ||
| return delete_term_meta( $object_id, $meta_key, $meta_value, $delete_all ); | ||
| } | ||
|
|
|
Good approach, only a few style fixes and the removal of a random paste needed. |
|
I have added some basic comments to this. @schlessera let me know if you want me to change them, I am not great for writing comments. Otherwise, I am happy with the PR as it is. Don't think there needs more work on it. This PR needs to be merged before, #159 as that PR will need to changed, to implement changes in this PR. The tests seem to be failing on trunk, but I think that is unreleated to my change... |
|
Ah, it seems to break on trunk now because a default I'll fix the tests for that. |
schlessera
left a comment
There was a problem hiding this comment.
This now contains lots of files from your IDE, please remove them from the pull request.
I recommend adding the .idea folder to your global git ignore list.
|
My bad. That is a silly make. Sorry, added .idea to gitignore file. |
|
@spacedmonkey I actually meant for you to add See https://help.github.com/articles/ignoring-files/#create-a-global-gitignore |
|
@schlessera Tests are passing and feedback done. |
|
@spacedmonkey I pushed a change to add full docblocks to the methods. While doing so, I noticed that the functions Currently, the Reading through the docs, it seems to me that this argument does not make any sense in our current context, and would be more useful for a separate command. How do you suggest we proceed? |
|
Thanks for the feedback @schlessera ! I have remove the |
In this PR, I abstract off the meta crud into there own method. This means that can overridden from the parent class.
fixes #172
related: #158