wpseek.com
A WordPress-centric search engine for devs and theme authors
block_core_navigation_link_build_variations › WordPress Function
Since6.5.0
Deprecatedn/a
› block_core_navigation_link_build_variations ( No parameters )
Returns: |
|
Defined at: |
|
Codex: |
Returns an array of variations for the navigation link block.
Source
function block_core_navigation_link_build_variations() { $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' ); $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 ) { $built_ins[] = $variation; } else { $variations[] = $variation; } } } return array_merge( $built_ins, $variations ); }