$args = array
();
$type =
isset( $request['type'
] ) ?
$request['type'
] : '';
$object_type =
isset( $request['object_type'
] ) ?
$request['object_type'
] : '';
$query =
isset( $request['q'
] ) ?
$request['q'
] : '';
$response_format =
isset( $request['response-format'
] ) ?
$request['response-format'
] : '';
if ( !
$response_format || !
in_array( $response_format, array
( 'json', 'markup'
), true
) ) { $response_format = 'json';
} if ( 'markup' ===
$response_format ) { $args['walker'
] =
new Walker_Nav_Menu_Checklist();
} if ( 'get-post-item' ===
$type ) { if ( post_type_exists( $object_type ) ) { if ( isset( $request['ID'
] ) ) { $object_id =
(int) $request['ID'
];
if ( 'markup' ===
$response_format ) { echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', array
( get_post( $object_id ) ) ),
0,