Skip to content

Line breaks in meta values break wp post meta list #262

@johnbillion

Description

@johnbillion

Given a post meta field with a value that contains line breaks, the output of wp post meta list breaks. Example:

$ wp post meta list 123
+---------+----------+------------+
| post_id | meta_key | meta_value |
+---------+----------+------------+
| 123     | foo      | foo        |
| 123     | bar      | bar
bar
bar
bar
bar
bar |
| 123     | baz      | baz        |
+---------+----------+------------+

Should this output be improved? A potential improvement would be:

+---------+----------+------------+
| post_id | meta_key | meta_value |
+---------+----------+------------+
| 123     | foo      | foo        |
| 123     | bar      | bar        |
|         |          | bar        |
|         |          | bar        |
|         |          | bar        |
|         |          | bar        |
| 123     | baz      | baz        |
+---------+----------+------------+

This might be difficult to implement though.

Note: The wp post get command doesn't suffer from this problem, which means line breaks in the post_content field don't break the output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions