Skip to content

Commit 1beca2d

Browse files
swissspidyCopilot
andauthored
Update src/Menu_Item_Command.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 71ffa89 commit 1beca2d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Menu_Item_Command.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,27 @@ public function get( $args, $assoc_args ) {
207207
// @phpstan-ignore property.notFound
208208
$menu_item->link = $menu_item->url;
209209

210+
if ( empty( $assoc_args['fields'] ) ) {
211+
$assoc_args['fields'] = [
212+
'db_id',
213+
'menu_item_parent',
214+
'object_id',
215+
'object',
216+
'type',
217+
'type_label',
218+
'title',
219+
'url',
220+
'link',
221+
'description',
222+
'attr_title',
223+
'target',
224+
'classes',
225+
'xfn',
226+
'menu_order',
227+
'position',
228+
'post_type',
229+
];
230+
}
210231
$formatter = $this->get_formatter( $assoc_args );
211232
$formatter->display_item( $menu_item );
212233
}

0 commit comments

Comments
 (0)