Add count to post-type and taxonomy commands#241
Conversation
|
The WP 3.7.11 test failed because the count for the I don't really have much experience with Behat so I'm not really sure what's the best approach here. |
|
@atanas-angelov-dev First of all, thanks for the PR, This looks like a great start! I'm still a bit wary of the performance impact of the count, so I suggest the following change:
Regarding the failure on WP 3.7, I don't think we need to bother with testing the counts on there. Just add a |
1c5ed14 to
8bf4d0c
Compare
|
@schlessera feedback has been addressed 👍 I had to limit the taxonomy tests to 5.0 as well since category count is 0 instead of 1 on 3.7.11 (guess Uncategorized is not created automatically under test conditions on that version or something?) |
schlessera
left a comment
There was a problem hiding this comment.
This is great code, @atanas-angelov-dev, you seem to have covered all the bases.
I only have two minor nitpicks, then we can merge this:
- Please use short array syntax, as we are at PHP 5.4+ now. I think I marked all the places with suggestions where this is needed, so you can just accept these.
- For the descriptions for the 4 commands you modified, you should add a mention of the new optional field to the
AVAILABLE OPTIONSsection in the docblock. You can see an example of this in the docblock for thewp post listcommand: https://github.com/wp-cli/entity-command/blob/v2.0.2/src/Post_Command.php#L525-L527
Note: Thewp taxonomy getcommand even seems to be missing the entireAVAILABLE OPTIONSsection, so please add that in one go now to be able to mention the optional field as well.
Once the above is changes, this can be merged.
8bf4d0c to
c561e95
Compare
|
@schlessera all done - I even ended up adjusting the default fields section for |
Fixes wp-cli/wp-cli#4573.
I took the liberty of implementing the term count for the
taxonomycommand as well even though it was not mentioned in the original issue as it is in a very similar situation.Feedback is very much welcome.