Skip to content

wp post list fails with "Invalid field" error if there's space after the comma separating the fields. #2711

@lordspace

Description

@lordspace
C:\qsandbox.com>wp post list --fields="ID,post_title" --format=json
[{"ID":14,"post_title":"\u041d\u043e\u0432 \u043f\u0440\u043e\u0434\u0443\u043a\
u0442 \u043d\u0430 \u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0430"},{"ID":4,"post_title":"Product 1"}]

// space after the comma
C:\qsandbox.com>wp post list --fields="ID, post_title" --format=json
Error: Invalid field:  post_title.
wp --info
PHP binary:     c:\php5\php.exe
PHP version:    5.4.17
php.ini used:   C:\php5\php.ini
WP-CLI root dir:        phar://wp-cli.phar
WP-CLI packages dir:    /.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 0.23.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions