Make WordPress Core


Ignore:
Timestamp:
05/03/2010 08:26:11 PM (17 years ago)
Author:
ryan
Message:

Strip trailing whites.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/nav-menu.php

    r14374 r14404  
    1717         */
    1818        function start_lvl(&$output, $depth) {}
    19        
     19
    2020        /**
    2121         * @see Walker_Nav_Menu::end_lvl()
    … …  
    2626         */
    2727        function end_lvl(&$output, $depth) {}
    28        
     28
    2929        /**
    3030         * @see Walker::start_el()
    … …  
    5050                        '_wpnonce',
    5151                );
    52                
     52
    5353                $original_title = '';
    5454                if ( 'taxonomy' == $item->type ) {
    … …  
    6060                ?>
    6161                <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>">
    62                         <dl class="<?php 
     62                        <dl class="<?php
    6363                                if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
    6464                                        echo 'menu-item-edit-active';
    … …  
    7272                                                <span class="item-order">
    7373                                                        <a href="<?php
    74                                                                 echo wp_nonce_url( 
     74                                                                echo wp_nonce_url(
    7575                                                                        add_query_arg(
    7676                                                                                array(
    77                                                                                         'action' => 'move-up-menu-item', 
     77                                                                                        'action' => 'move-up-menu-item',
    7878                                                                                        'menu-item' => $item_id,
    7979                                                                                ),
    80                                                                                 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 
    81                                                                         ), 
    82                                                                         'move-item' 
    83                                                                 ); 
     80                                                                                remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
     81                                                                        ),
     82                                                                        'move-item'
     83                                                                );
    8484                                                        ?>" class="item-move-up"><abbr title="<?php esc_attr_e('Move up'); ?>">&#8593;</abbr></a>
    8585                                                        |
    8686                                                        <a href="<?php
    87                                                                 echo wp_nonce_url( 
     87                                                                echo wp_nonce_url(
    8888                                                                        add_query_arg(
    8989                                                                                array(
    90                                                                                         'action' => 'move-down-menu-item', 
     90                                                                                        'action' => 'move-down-menu-item',
    9191                                                                                        'menu-item' => $item_id,
    9292                                                                                ),
    93                                                                                 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 
    94                                                                         ), 
     93                                                                                remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
     94                                                                        ),
    9595                                                                        'move-item'
    96                                                                 ); 
     96                                                                );
    9797                                                        ?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?>">&#8595;</abbr></a>
    9898                                                </span>
    99                                                 <a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php _e('Edit Menu Item'); ?>" href="<?php 
    100                                                         echo add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) ); 
     99                                                <a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php _e('Edit Menu Item'); ?>" href="<?php
     100                                                        echo add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) );
    101101                                                ?>#menu-item-settings-<?php echo $item_id; ?>">Edit Menu Item</a>
    102102                                        </span>
    … …  
    104104                        </dl>
    105105
    106                         <div class="menu-item-settings <?php 
     106                        <div class="menu-item-settings <?php
    107107                                if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
    108108                                        echo 'menu-item-edit-active';
    109109                                else
    110110                                        echo 'menu-item-edit-inactive';
    111                         ?>" id="menu-item-settings-<?php echo $item_id; ?>">           
     111                        ?>" id="menu-item-settings-<?php echo $item_id; ?>">
    112112                                <?php if( 'custom' == $item->type ) : ?>
    113113                                        <p class="field-url description description-wide">
    … …  
    158158                                        </label>
    159159                                </p>
    160                                
     160
    161161                                <span class="menu-item-actions description-wide submitbox">
    162162                                        <?php if( 'custom' != $item->type ) : ?>
    163163                                                <p class="link-to-original"><?php
    164                                                         _e('Original '); 
     164                                                        _e('Original ');
    165165                                                        echo esc_html( $item->append );
    166166                                                        echo ":"; ?>
    … …  
    170170                                                </p>
    171171                                        <?php endif; ?>
    172                                         <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php 
     172                                        <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php
    173173                                        echo wp_nonce_url(
    174174                                                add_query_arg(
    … …  
    177177                                                                'menu-item' => $item_id,
    178178                                                        ),
    179                                                         remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 
     179                                                        remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
    180180                                                ),
    181181                                                'delete-menu_item_' . $item_id
    … …  
    183183                                        <input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" />
    184184                                </span>
    185                                
     185
    186186                                <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
    187187                                <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
    … …  
    191191                                <input class="menu-item-data-position" type="hidden" class="menu-item-position" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
    192192                                <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
    193                         </div><!-- .menu-item-settings-->       
     193                        </div><!-- .menu-item-settings-->
    194194                        <ul class="menu-item-transport"></ul>
    195195                <?php
    … …  
    202202 *
    203203 * @since 3.0.0
    204  * 
     204 *
    205205 * @param array $request The unsanitized request values.
    206206 */
    … …  
    314314        wp_nav_menu_post_type_meta_boxes();
    315315        wp_nav_menu_taxonomy_meta_boxes();
    316        
    317        
     316
     317
    318318        // Register advanced menu items (columns)
    319319        add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns');
    320        
     320
    321321        add_filter( 'columns_prefs_header', create_function( '', "return __('Show advanced menu properties');" ));
    322        
    323        
    324        
     322
     323
     324
    325325        // If first time editing, disable advanced items by default.
    326326        if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
    … …  
    423423
    424424        $removed_args = array(
    425                 'action', 
     425                'action',
    426426                'customlink-tab',
    427427                'edit-menu-item',
    … …  
    477477        $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
    478478
    479         $args = array( 
    480                 'offset' => $offset, 
     479        $args = array(
     480                'offset' => $offset,
    481481                'order' => 'ASC',
    482                 'orderby' => 'title', 
    483                 'posts_per_page' => $per_page, 
    484                 'post_type' => $post_type_name, 
    485                 'suppress_filters' => true, 
     482                'orderby' => 'title',
     483                'posts_per_page' => $per_page,
     484                'post_type' => $post_type_name,
     485                'suppress_filters' => true,
    486486        );
    487487
    … …  
    512512                $parent_ids = array_unique($parent_ids);
    513513                $child_ids = array_unique($child_ids);
    514                
     514
    515515                $missing_parents = array();
    516516                do {
    … …  
    521521                                $parent_ids[] = $missing_parent->post_parent;
    522522                        }
    523                        
     523
    524524                        $missing_parents = array_filter( array_diff( array_unique( $parent_ids ), array_unique( $child_ids ) ) );
    525525
    526526                } while( 0 < count( $missing_parents ) );
    527                
     527
    528528        }
    529529
    530530        $page_links = paginate_links( array(
    531                 'base' => add_query_arg( 
     531                'base' => add_query_arg(
    532532                        array(
    533533                                $post_type_name . '-tab' => 'all',
    … …  
    535535                        )
    536536                ),
    537                 'format' => '', 
     537                'format' => '',
    538538                'prev_text' => __('&laquo;'),
    539539                'next_text' => __('&raquo;'),
    … …  
    541541                'current' => $pagenum
    542542        ));
    543        
     543
    544544        if ( !$posts )
    545545                $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>';
    … …  
    555555
    556556        $removed_args = array(
    557                 'action', 
     557                'action',
    558558                'customlink-tab',
    559559                'edit-menu-item',
    … …  
    570570                </ul>
    571571
    572                 <div class="tabs-panel <?php 
     572                <div class="tabs-panel <?php
    573573                        echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    574574                ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
    575                         <?php 
     575                        <?php
    576576                        if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
    577577                                $searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] );
    … …  
    615615                                if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
    616616                                        $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items);
    617                                        
     617
    618618                                }
    619619                                echo $checkbox_items;
    … …  
    628628                <p class="button-controls">
    629629                        <span class="list-controls">
    630                                 <a href="<?php 
     630                                <a href="<?php
    631631                                        echo add_query_arg(
    632632                                                array(
    … …  
    670670
    671671        $args = array(
    672                 'child_of' => 0, 
     672                'child_of' => 0,
    673673                'exclude' => '',
    674                 'hide_empty' => false, 
    675                 'hierarchical' => 1, 
    676                 'include' => '', 
    677                 'include_last_update_time' => false, 
    678                 'number' => $per_page, 
     674                'hide_empty' => false,
     675                'hierarchical' => 1,
     676                'include' => '',
     677                'include_last_update_time' => false,
     678                'number' => $per_page,
    679679                'offset' => $offset,
    680680                'order' => 'ASC',
    681                 'orderby' => 'name', 
     681                'orderby' => 'name',
    682682                'pad_counts' => false,
    683683        );
    … …  
    686686
    687687        $page_links = paginate_links( array(
    688                 'base' => add_query_arg( 
     688                'base' => add_query_arg(
    689689                        array(
    690690                                $taxonomy_name . '-tab' => 'all',
    … …  
    692692                        )
    693693                ),
    694                 'format' => '', 
     694                'format' => '',
    695695                'prev_text' => __('&laquo;'),
    696696                'next_text' => __('&raquo;'),
    … …  
    698698                'current' => $pagenum
    699699        ));
    700        
     700
    701701        $walker = new Walker_Nav_Menu_Checklist;
    702702        // @todo transient caching of these results with proper invalidation on updating of a tax of this type
    … …  
    716716
    717717        $removed_args = array(
    718                 'action', 
     718                'action',
    719719                'customlink-tab',
    720720                'edit-menu-item',
    … …  
    741741                                echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args );
    742742                                ?>
    743                                 <?php 
     743                                <?php
    744744                                ?>
    745745                        </ul>
    746746                </div><!-- /.tabs-panel -->
    747747
    748                 <div class="tabs-panel <?php 
     748                <div class="tabs-panel <?php
    749749                        echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
    750750                ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
    751                         <?php 
     751                        <?php
    752752                        if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) {
    753753                                $searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] );
    … …  
    762762                                <input type="submit" class="quick-search-submit button-secondary" value="<?php esc_attr_e('Search'); ?>" />
    763763                        </p>
    764                
     764
    765765                        <ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear">
    766766                        <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
    … …  
    796796                <p class="button-controls">
    797797                        <span class="list-controls">
    798                                 <a href="<?php 
     798                                <a href="<?php
    799799                                        echo add_query_arg(
    800800                                                array(
    … …  
    835835                // Loop through all the menu items' POST values
    836836                foreach( (array) $menu_data as $_possible_db_id => $_item_object_data ) {
    837                         if ( 
     837                        if (
    838838                                empty( $_item_object_data['menu-item-object-id'] ) && // checkbox is not checked
    839                                 ( 
    840                                         ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set 
     839                                (
     840                                        ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set
    841841                                        in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || // or URL is the default
    842                                         'custom' != $_item_object_data['menu-item-type'] ||  // or it's not a custom menu item 
     842                                        'custom' != $_item_object_data['menu-item-type'] ||  // or it's not a custom menu item
    843843                                        ! empty( $_item_object_data['menu-item-db-id'] ) // or it *is* a custom menu item that already exists
    844844                                )
    … …  
    848848
    849849                        // if this possible menu item doesn't actually have a menu database ID yet
    850                         if ( 
     850                        if (
    851851                                empty( $_item_object_data['menu-item-db-id'] ) ||
    852852                                ( 0 > $_possible_db_id ) ||
    … …  
    857857                                $_actual_db_id = (int) $_item_object_data['menu-item-db-id'];
    858858                        }
    859                        
     859
    860860                        $args = array(
    861861                                'menu-item-db-id' => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ),
    … …  
    886886 *
    887887 * @since 3.0.0
    888  * 
     888 *
    889889 * @access private
    890890 *
    … …  
    897897                if ( 'attachment' == $object->name )
    898898                        return false;
    899        
     899
    900900                // pages should show most recent
    901901                if ( 'page' == $object->name ) {
    … …  
    920920                }
    921921        }
    922        
     922
    923923        return $object;
    924924}
    … …  
    934934function wp_get_nav_menu_to_edit( $menu_item_id = 0 ) {
    935935        $menu = wp_get_nav_menu_object( $menu_item_id );
    936        
     936
    937937        // If the menu exists, get its items.
    938938        if ( is_nav_menu( $menu ) ) {
    939939                $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') );
    940940
    941                 $walker = new Walker_Nav_Menu_Edit; 
     941                $walker = new Walker_Nav_Menu_Edit;
    942942
    943943                return walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $menu_items), 0, (object) array('walker' => $walker ) );
    944944        } elseif ( is_wp_error( $menu ) ) {
    945                 return $menu;   
     945                return $menu;
    946946        }
    947947
Note: See TracChangeset for help on using the changeset viewer.