Skip to content

Commit c764923

Browse files
authored
Merge pull request #578 from wp-cli/regenerate-readme
Regenerate README file
2 parents c5a82a2 + 18303d2 commit c764923

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,79 @@ wp menu item delete <db-id>...
11301130

11311131

11321132

1133+
### wp menu item get
1134+
1135+
Gets details about a menu item.
1136+
1137+
~~~
1138+
wp menu item get <db-id> [--field=<field>] [--fields=<fields>] [--format=<format>]
1139+
~~~
1140+
1141+
**OPTIONS**
1142+
1143+
<db-id>
1144+
Database ID for the menu item.
1145+
1146+
[--field=<field>]
1147+
Instead of returning the whole menu item, returns the value of a single field.
1148+
1149+
[--fields=<fields>]
1150+
Limit the output to specific fields. Defaults to db_id, type, title, link, position.
1151+
1152+
[--format=<format>]
1153+
Render output in a particular format.
1154+
---
1155+
default: table
1156+
options:
1157+
- table
1158+
- csv
1159+
- json
1160+
- yaml
1161+
---
1162+
1163+
**AVAILABLE FIELDS**
1164+
1165+
These fields are available:
1166+
1167+
* db_id
1168+
* type
1169+
* title
1170+
* link
1171+
* position
1172+
* menu_item_parent
1173+
* object_id
1174+
* object
1175+
* type_label
1176+
* target
1177+
* attr_title
1178+
* description
1179+
* classes
1180+
* xfn
1181+
1182+
**EXAMPLES**
1183+
1184+
# Get details about a menu item with ID 45
1185+
$ wp menu item get 45
1186+
+-------------+----------------------------------+
1187+
| Field | Value |
1188+
+-------------+----------------------------------+
1189+
| db_id | 45 |
1190+
| type | custom |
1191+
| title | WordPress |
1192+
| link | https://wordpress.org |
1193+
| position | 1 |
1194+
+-------------+----------------------------------+
1195+
1196+
# Get a specific field from a menu item
1197+
$ wp menu item get 45 --field=title
1198+
WordPress
1199+
1200+
# Get menu item data in JSON format
1201+
$ wp menu item get 45 --format=json
1202+
{"db_id":45,"type":"custom","title":"WordPress","link":"https://wordpress.org","position":1}
1203+
1204+
1205+
11331206
### wp menu item list
11341207

11351208
Gets a list of items associated with a menu.

0 commit comments

Comments
 (0)