Skip to content

Commit beccc58

Browse files
committed
Use value instead of ID for the primary key column
1 parent fd762a7 commit beccc58

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/DB_Command.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,14 +1301,14 @@ public function prefix() {
13011301
*
13021302
* # Search for a string and print the result as a table
13031303
* $ wp db search https://localhost:8889 --format=table
1304-
* +------------+--------------+-----------+----+-----------------------------+
1305-
* | table | column | key | ID | match |
1306-
* +------------+--------------+-----------+----+-----------------------------+
1307-
* | wp_options | option_value | option_id | 1 | https://localhost:8889 |
1308-
* | wp_options | option_value | option_id | 2 | https://localhost:8889 |
1309-
* | wp_posts | guid | ID | 1 | https://localhost:8889/?p=1 |
1310-
* | wp_users | user_url | ID | 1 | https://localhost:8889 |
1311-
* +------------+--------------+-----------+----+-----------------------------+
1304+
* +------------+--------------+-----------+-------+-----------------------------+
1305+
* | table | column | key | value | match |
1306+
* +------------+--------------+-----------+-------+-----------------------------+
1307+
* | wp_options | option_value | option_id | 1 | https://localhost:8889 |
1308+
* | wp_options | option_value | option_id | 2 | https://localhost:8889 |
1309+
* | wp_posts | guid | ID | 1 | https://localhost:8889/?p=1 |
1310+
* | wp_users | user_url | ID | 1 | https://localhost:8889 |
1311+
* +------------+--------------+-----------+-------+-----------------------------+
13121312
*
13131313
* # Search for a string and get only the IDs (only works for a single table)
13141314
* $ wp db search https://localhost:8889 wp_options --format=ids
@@ -1504,7 +1504,7 @@ public function search( $args, $assoc_args ) {
15041504
$formatter_args = [
15051505
'format' => $format,
15061506
];
1507-
$formatter_fields = [ 'table', 'column', 'key', 'ID', 'match' ];
1507+
$formatter_fields = [ 'table', 'column', 'key', 'value', 'match' ];
15081508

15091509
if ( $fields ) {
15101510
$fields = explode( ',', $assoc_args['fields'] );

0 commit comments

Comments
 (0)