$taxonomies =
get_taxonomies( array
( 'show_in_nav_menus' => true
), 'objects'
);
// Use two separate arrays as a way to order the variations in the UI.
// Known variations (like Post Link and Page Link) are added to the
// `built_ins` array. Variations for custom post types and taxonomies are
// added to the `variations` array and will always appear after `built-ins.
$built_ins = array
();
$variations = array
();
if ( $post_types ) { foreach ( $post_types as $post_type ) { $variation =
build_variation_for_navigation_link( $post_type, 'post-type'
);
if ( $post_type->_builtin
) { $built_ins[] =
$variation;
} else { $variations[] =
$variation;
} } } if ( $taxonomies ) { foreach ( $taxonomies as $taxonomy ) { $variation =
build_variation_for_navigation_link( $taxonomy, 'taxonomy'
);
if ( $taxonomy->_builtin
) {