Skip to content

Commit e2aa535

Browse files
committed
Add meta_query as well
1 parent 37df404 commit e2aa535

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

features/post.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,12 @@ Feature: Manage WordPress posts
447447
| {POST_ID} | key2 | value2b |
448448
| {POST_ID} | key3 | value3 |
449449

450+
When I run `wp post list --field=post_title --meta_query='[{"key":"key2","value":"value2b"}]'`
451+
Then STDOUT should contain:
452+
"""
453+
Test Post
454+
"""
455+
450456
@less-than-wp-4.4
451457
Scenario: Creating/updating posts with meta keys for WP < 4.4 has no effect so should give warning
452458
When I try `wp post create --post_title='Test Post' --post_content='Test post content' --meta_input='{"key1":"value1","key2":"value2"}' --porcelain`

src/Post_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ public function list_( $args, $assoc_args ) {
636636
'posts_per_page' => -1,
637637
'post_status' => 'any',
638638
];
639-
$array_arguments = [ 'date_query', 'tax_query' ];
639+
$array_arguments = [ 'date_query', 'tax_query', 'meta_query' ];
640640
$assoc_args = Utils\parse_shell_arrays( $assoc_args, $array_arguments );
641641
$query_args = array_merge( $defaults, $assoc_args );
642642
$query_args = self::process_csv_arguments_to_arrays( $query_args );

0 commit comments

Comments
 (0)