Custom Post Type With Hierarchical Set To True On Large Data Sets Breaks
-
So lets see if I can explain this in detail, first let me tell you that I have exactly 20,337 posts in my custom post type and the code to register that post type is below.
register_post_type( 'tv_shows', array( 'labels' => array( 'name' => __( 'Tv Shows' ), 'singular_name' => __( 'Tv Show' ), 'add_new' => _x('Add New', 'tv_shows'), 'add_new_item' => __("Add New Tv Show"), 'edit_item' => __("Edit Shows"), 'new_item' => __("New Show"), 'view_item' => __("View Show"), 'search_items' => __("Search Shows"), 'not_found' => __('No shows found'), 'not_found_in_trash' => __('No shows found in Trash') ), 'description' => __( 'Used to add television shows to your wordpress blog.' ), 'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'custom-fields' ), 'taxonomies' => array( 'genres' ), 'hierarchical' => false, 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => 'shows' ) ) );
Now in the admin panel when I click on my custom post type to view/edit/update those posts a typical list of 20 entries per page appears just like they should using the code I posted above, the code above as it stands works 100%.
However when I change the hierarchical option to true, things go haywire, when this option is set to true (Yes I need, well really want it set to true) WordPress seemly skips out on paging and attempt to load all 20,337 records on the same page instead of just 20 with paging like it does with the code above.
At first I thought ok well this might be caused from having all my menu_order options set to true (Yes oops my bad when populating the database), so what I did was make all the menu_order fields unique as they would normally appear adding all entries by hand and this didn’t help either.
So my question is when using large custom data sets with hierarchical set to true, does anyone know how to make it page inside of the admin panel and not attempt to open up all records on the same page.
This might even be a bug because it sure does boggle my mind, I’ve been developing websites for 10+ years and been customizing and working with WordPress for many of those years but my mind is fried on this one haha.
Thanks in advance for any help.
P.S. If you are confused by what I wrote or need more clarification, please feel free to say so and feel free to use complex terminology, I’ve been around the block a few times and can handle what you toss at me :).
- The topic ‘Custom Post Type With Hierarchical Set To True On Large Data Sets Breaks’ is closed to new replies.