WordPress.org

Make WordPress Core

Ticket #18958: 18958.2.patch

File 18958.2.patch, 1.8 KB (added by SergeyBiryukov, 7 years ago)
  • wp-admin/includes/class-wp-posts-list-table.php

     
    9494
    9595                $total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts;
    9696
    97                 $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
     97                $per_page = $this->get_items_per_page( 'edit_' . str_replace( '-', '_', $post_type ) . '_per_page' );
    9898                $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
    9999
    100100                if ( $this->hierarchical_display )
  • wp-admin/includes/misc.php

     
    335335                $map_option = $option;
    336336                $type = str_replace('edit_', '', $map_option);
    337337                $type = str_replace('_per_page', '', $type);
    338                 if ( in_array($type, get_post_types()) )
     338                if ( in_array( $type, str_replace( '-', '_', get_post_types() ) ) )
    339339                        $map_option = 'edit_per_page';
    340340                if ( in_array( $type, get_taxonomies()) )
    341341                        $map_option = 'edit_tags_per_page';
  • wp-admin/includes/post.php

     
    871871        elseif ( isset($q['post_status']) && 'pending' == $q['post_status'] )
    872872                $order = 'ASC';
    873873
    874         $per_page = 'edit_' . $post_type . '_per_page';
     874        $per_page = 'edit_' . str_replace( '-', '_', $post_type ) . '_per_page';
    875875        $posts_per_page = (int) get_user_option( $per_page );
    876876        if ( empty( $posts_per_page ) || $posts_per_page < 1 )
    877877                $posts_per_page = 20;