WordPress.org

Make WordPress Core

Ticket #16355: 16355.2.diff

File 16355.2.diff, 1.6 KB (added by nacin, 7 years ago)

Includes simplified version of Sergey's patch. show_sticky is boolean.

  • wp-admin/edit.php

     
    3535}
    3636unset( $_redirect );
    3737
     38if ( 'post' != $post_type ) {
     39        $parent_file = "edit.php?post_type=$post_type";
     40        $submenu_file = "edit.php?post_type=$post_type";
     41        $post_new_file = "post-new.php?post_type=$post_type";
     42} else {
     43        $parent_file = 'edit.php';
     44        $submenu_file = 'edit.php';
     45        $post_new_file = 'post-new.php';
     46}
     47
    3848$doaction = $wp_list_table->current_action();
    3949
    4050if ( $doaction ) {
     
    5969        }
    6070
    6171        if ( !isset( $post_ids ) ) {
    62                 wp_redirect( admin_url("edit.php?post_type=$post_type") );
     72                wp_redirect( $sendback );
    6373                exit;
    6474        }
    6575
     
    130140         exit;
    131141}
    132142
    133 if ( 'post' != $post_type ) {
    134         $parent_file = "edit.php?post_type=$post_type";
    135         $submenu_file = "edit.php?post_type=$post_type";
    136         $post_new_file = "post-new.php?post_type=$post_type";
    137 } else {
    138         $parent_file = 'edit.php';
    139         $submenu_file = 'edit.php';
    140         $post_new_file = 'post-new.php';
    141 }
    142 
    143143$wp_list_table->prepare_items();
    144144
    145145$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
     
    246246
    247247<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
    248248<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
     249<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
     250<input type="hidden" name="show_sticky" value="1" />
     251<?php } ?>
    249252
    250253<?php $wp_list_table->display(); ?>
    251254