Make WordPress Core


Ignore:
Timestamp:
06/14/2010 07:52:30 PM (14 years ago)
Author:
nacin
Message:

Revert [15219], [15250], some of [15249] for 3.0, revisit in 3.0.1. see #13822.

File:
1 edited

Legend:

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

    r15250 r15254  
    7272
    7373        if ( isset( $item->post_status ) && 'draft' == $item->post_status ) {
    74             $original_status = get_post_status_object( $original_object->post_status );
    75             $classes[] = "draft post-status-$original_object->post_status";
    76             /* translators: 1: title of menu item in draft status, 2: actual post status. */
    77             $title = sprintf( __('%1$s (%2$s)'), $item->title, $original_status->label );
    78         } elseif ( isset( $item->post_status ) && 'pending' == $item->post_status ) {
    79             $classes[] = 'unsaved';
    80             /* translators: %s: title of menu item in pending status */
    81             $title = sprintf( __('%s (Unsaved)'), $item->title );
     74            $classes[] = 'pending';
     75            /* translators: %s: title of menu item in draft status */
     76            $title = sprintf( __('%s (Pending)'), $item->title );
    8277        }
    8378
     
    178173                    <?php if( 'custom' != $item->type ) : ?>
    179174                        <p class="link-to-original">
    180                             <?php
    181                             $post_status = get_post_status( $item->object_id );
    182                             if( 'publish' == $post_status ) {
    183                                 printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>', '' );
    184                             } else {
    185                                 $original_url = $item->url;
    186                                 if( 'trash' == $post_status ) {
    187                                     $original_url = add_query_arg(
    188                                         array(
    189                                             'post_status' => 'trash',
    190                                             'post_type' => $item->object,
    191                                         ),
    192                                         admin_url( 'edit.php' )
    193                                     );
    194                                 }
    195                                 $post_status_obj = get_post_status_object( $post_status );
    196                                 /* translators: 1: title, 2: post status. */
    197                                 printf( __('Original: %1$s (%2$s)'), '<a href="' . esc_attr( $original_url ) . '">' . esc_html( $original_title ) . '</a>',
    198                                 $post_status_obj->label );
    199                             }
    200                             ?>
     175                            <?php printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
    201176                        </p>
    202177                    <?php endif; ?>
     
    220195                <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_item_parent ); ?>" />
    221196                <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
    222                 <input class="menu-item-data-status" type="hidden" name="menu-item-status[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_status ); ?>" />
    223197                <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
    224198            </div><!-- .menu-item-settings-->
     
    974948 * @since 3.0.0
    975949 *
    976  * @param int $menu_id The menu ID for which to save this item. $menu_id of 0 makes a pending, orphaned menu item.
     950 * @param int $menu_id The menu ID for which to save this item. $menu_id of 0 makes a draft, orphaned menu item.
    977951 * @param array $menu_data The unsanitized posted menu item data.
    978952 * @return array The database IDs of the items saved
     
    11061080        $some_pending_menu_items = false;
    11071081        foreach( (array) $menu_items as $menu_item ) {
    1108             if ( isset( $menu_item->post_status ) && 'pending' == $menu_item->post_status )
     1082            if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status )
    11091083                $some_pending_menu_items = true;
    11101084        }
    11111085
    11121086        if ( $some_pending_menu_items )
    1113             $result .= '<div class="updated inline"><p>' . __('Click Save Menu to make unsaved menu items public.') . '</p></div>';
     1087            $result .= '<div class="updated inline"><p>' . __('Click Save Menu to make pending menu items public.') . '</p></div>';
    11141088
    11151089        $result .= '<ul class="menu" id="menu-to-edit"> ';
     
    11441118
    11451119/**
    1146  * Deletes orphaned pending menu items
     1120 * Deletes orphaned draft menu items
    11471121 *
    11481122 * @access private
     
    11501124 *
    11511125 */
    1152 function _wp_delete_orphaned_pending_menu_items() {
     1126function _wp_delete_orphaned_draft_menu_items() {
    11531127    global $wpdb;
    11541128    $delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS);
    11551129
    1156     // delete orphaned pending menu items
    1157     $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'pending' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) );
     1130    // delete orphaned draft menu items
     1131    $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) );
    11581132
    11591133    foreach( (array) $menu_items_to_delete as $menu_item_id )
     
    11611135}
    11621136
    1163 add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_pending_menu_items');
     1137add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items');
    11641138
    11651139?>
Note: See TracChangeset for help on using the changeset viewer.