how do I display Quick Edit box on a custom plugin page with a list of posts?
how do I display Quick Edit box on a custom plugin page with a list of posts?
how do I display Quick Edit box on a custom plugin page with a list of posts?
After exploring several options, I landed on this as the cleanest server side alternative: add_filter(‘admin_head-edit.php’,function(){ $screen = get_current_screen(); if( post_type_supports($screen->post_type,’author’ )){ // remove from bulk/quick edit remove_post_type_support($screen->post_type,’author’); add_filter( ‘manage_posts_columns’, function($columns){ $columns[‘author’] = __(‘Author’); return $columns; }); } });
Here is my meccano made of pieces found somewhere around. This code is from one of my unfinished and abandoned projects, but it worked (to my personal memory). Note that I’ve prefixed the meta name with the underscore (_tie_post_views) to avoid its appearance in Custom Fields metabox on Post Edit page. You’ll be forced to … Read more
I did solve this by setting the show_ui to false for specific taxonomies… but only on the edit.php screen. Then I added custom columns with my own custom quick edit to mimic the regular quick edit but using a custom Walker. If you add columns with a taxonomy name, WordPress automatically generates the quick edit, … Read more
Not sure it’s the best code but I’ve tested something here that works : (function ($) { // copy of the WP inline edit post var wp_inline_edit = inlineEditPost.edit; // override inlineEditPost.edit = function (id) { // WP edit function wp_inline_edit.apply(this, arguments); // get post ID var post_id = 0; if (typeof( id ) === … Read more
The solution was on the jquery side of things. The .on function needed to bubble upwards to be sure that it was always getting the most recent, ajax-added content. I only had to adjust the first line to be more aligned with jquery documentation for .on(). $( ‘#the-list’ ).on( ‘click’, ‘.editinline’, function(){ // revert Quick … Read more
Use current_user_can to wrap the add_filter call: if ( current_user_can(‘manage_options’) ) { } else { add_filter(‘post_row_actions’,’remove_quick_edit’,10,1); } manage_options is an Admin capability. If the current user can do it, he’s an admin (on a vanilla WP installation). See: http://codex.wordpress.org/Roles_and_Capabilities and http://codex.wordpress.org/Function_Reference/current_user_can