[wp-trac] [WordPress Trac] #19343: Allow Quick Edit to be Disabled for Custom Post Types

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 23 19:41:03 UTC 2011


#19343: Allow Quick Edit to be Disabled for Custom Post Types
-----------------------------+-----------------------------
 Reporter:  Jick             |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Quick/Bulk Edit  |    Version:  3.3
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 For some custom post types, quick edit doesn't make sense, and it's not
 easy to disable the quick edit code. You can use CSS to hide it but that
 still requires the code to be sent to the browser when it's not even
 needed.

 The only other solution is to extend the ''WP_Posts_List_Table'' class and
 set the ''inline_edit()'' function to return nothing. Something like this:
 {{{
 if(!class_exists('WP_List_Table')) {
         require_once(ABSPATH . 'wp-admin/includes/class-wp-list-
 table.php');
 }

 if(!class_exists('WP_Posts_List_Table')) {
         require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-
 table.php');
 }

 class My_Posts_List_Table extends WP_Posts_List_Table {
         function inline_edit(){}
 }

 function my_admin_head() {
         $wp_list_table = new My_Posts_List_Table();
         $wp_list_table->prepare_items();
 }

 add_action('admin_head-edit.php', 'my_admin_head');
 }}}
 Clearly, that is a lot of code to accomplish something so simple.

 So, it would be nice if there was some way to disable quick edit. Maybe it
 could be a feature you could disable via the "''supports''" option when
 you register the custom post type?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19343>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list