Make WordPress Core

Ticket #25528: nav-menus-hook-docs.diff

File nav-menus-hook-docs.diff, 2.9 KB (added by pauldewouters, 12 years ago)
  • src/wp-admin/nav-menus.php

     
    33 * WordPress Administration for Navigation Menus
    44 * Interface functions
    55 *
    6  * @version 2.0.0
     6 * @link http://codex.wordpress.org/Navigation_Menus
     7 * @since 2.0.0
    78 *
    89 * @package WordPress
    910 * @subpackage Administration
    1011 */
    1112
    12 /** Load WordPress Administration Bootstrap */
     13/**
     14 * Load WordPress Administration Bootstrap
     15 */
    1316require_once( dirname( __FILE__ ) . '/admin.php' );
    1417
    15 // Load all the nav menu interface functions
     18/**
     19 * Load all the nav menu interface functions
     20 */
    1621require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
    1722
    1823if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' ) )
     
    461466        $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
    462467}
    463468
     469/**
     470 * Appends a menu-max-depth-n class to the admin body classes where n represents the max level of the nav menu.
     471 *
     472 * @global int $_wp_nav_menu_max_depth Number of levels of the nav menu.
     473 *
     474 * @param string $classes Admin body tag classes.
     475 * @return string Body classes.
     476 */
    464477function wp_nav_menu_max_depth($classes) {
    465478        global $_wp_nav_menu_max_depth;
    466479        return "$classes menu-max-depth-$_wp_nav_menu_max_depth";
     
    529542        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    530543);
    531544
    532 // Get the admin header
     545/**
     546 * Get the admin header
     547 */
    533548require_once( ABSPATH . 'wp-admin/admin-header.php' );
    534549?>
    535550<div class="wrap">
     
    602617                        <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
    603618                </form>
    604619        </div><!-- #menu-locations-wrap -->
    605         <?php do_action( 'after_menu_locations_table' ); ?>
     620        <?php
     621                /**
     622                 * Fires actions to be run after displaying the menu locations table.
     623                 *
     624                 * @since 3.6
     625                 */
     626                do_action( 'after_menu_locations_table' );
     627                ?>
    606628        <?php else : ?>
    607629        <div class="manage-menus">
    608630                <?php if ( $menu_count < 2 ) : ?>
     
    627649                                                        foreach ( array_keys( $menu_locations, $_nav_menu->term_id ) as $menu_location_key ) {
    628650                                                                 $locations_assigned_to_this_menu[] = $locations[ $menu_location_key ];
    629651                                                        }
     652
     653                                                        /**
     654                                                         * Filter the nav menu assigned locations.
     655                                                         *
     656                                                         * @since 3.6
     657                                                         */
    630658                                                        $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) ) );
    631659
    632660                                                        // Adds ellipses following the number of locations defined in $assigned_locations
     
    762790        </div><!-- /#nav-menus-frame -->
    763791        <?php endif; ?>
    764792</div><!-- /.wrap-->
    765 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
     793<?php
     794/**
     795 * Load the admin footer template.
     796 */
     797include( ABSPATH . 'wp-admin/admin-footer.php' );
     798?>