WordPress.org

Make WordPress Core

Ticket #13378: 14720.patch

File 14720.patch, 2.9 KB (added by jorbin, 8 years ago)

inline docs for some functions added/changed

  • wp-includes/nav-menu-template.php

     
    183183 * depth - how many levels of the hierarchy are to be included.  0 means all.  Defaults to 0.
    184184 * walker - allows a custom walker to be specified.
    185185 * context - the context the menu is used in.
    186  *
     186 * theme_location - the location in the theme to be used.  Must be registed with register_nav_menu in order to be selectable by the user
     187 *
    187188 * @todo show_home - If you set this argument, then it will display the link to the home page. The show_home argument really just needs to be set to the value of the text of the link.
    188189 *
    189190 * @since 3.0.0
  • wp-includes/nav-menu.php

     
    1212 *
    1313 * @since 3.0.0
    1414 *
    15  * @param string $menu Menu id
    16  * @return mixed $menu|false Or WP_Error
     15 * @uses get_term
     16 * @uses get_term_by
     17 *
     18 * @param string $menu Menu id, slug or name
     19 * @return mixed false if $menu param isn't supplied or term does not exist, menu object if successfull
    1720 */
    1821function wp_get_nav_menu_object( $menu ) {
    1922        if ( ! $menu )
     
    4144 *
    4245 * @since 3.0.0
    4346 *
    44  * @param int|string $menu The menu to check
     47 * @param int|string $menu The menu to check (ID, Slug, or Name)
    4548 * @return bool Whether the menu exists.
    4649 */
    4750function is_nav_menu( $menu ) {
     
    8790function register_nav_menu( $location, $description ) {
    8891        register_nav_menus( array( $location => $description ) );
    8992}
    90 
     93/**
     94 * Returns an array of all registered nav menus in a theme
     95 *
     96 * @since 3.0.0
     97 *
     98 * @return array
     99 *
     100 */
    91101function get_registered_nav_menus() {
    92102        return $GLOBALS['_wp_registered_nav_menus'];
    93103}
    94104
     105/**
     106 * Returns an array with the registered nav menu locations and the menu assigned to it
     107 *
     108 * @since 3.0.0
     109 *
     110 * @retun array
     111 */
     112
    95113function get_nav_menu_locations() {
    96114        return get_theme_mod('nav_menu_locations');
    97115}
     
    468486                        $object_id = get_post_meta( $item->ID, '_menu_item_object_id', true );
    469487                        $object = get_post_meta( $item->ID, '_menu_item_object', true );
    470488                        $type = get_post_meta( $item->ID, '_menu_item_type', true );
    471        
     489
    472490                        if ( 'post_type' == $type )
    473491                                $posts[$object][] = $object_id;
    474492                        elseif ( 'taxonomy' == $type)
    475493                                $terms[$object][] = $object_id;
    476494                }
    477        
     495
    478496                if ( !empty($posts) ) {
    479497                        foreach ( array_keys($posts) as $post_type ) {
    480498                                get_posts( array('post__in' => $posts[$post_type], 'post_type' => $post_type, 'nopaging' => true, 'update_post_term_cache' => false) );
    481499                        }
    482500                }
    483501                unset($posts);
    484        
     502
    485503                if ( !empty($terms) ) {
    486504                        foreach ( array_keys($terms) as $taxonomy ) {
    487505                                get_terms($taxonomy, array('include' => $terms[$taxonomy]) );