How to verify nonce from Bulk/Quick Edit in save_post?
It’s inlineeditnonce. Check line 1185 of admin-ajax.php for details.
It’s inlineeditnonce. Check line 1185 of admin-ajax.php for details.
Check out the builk actions page in the codex. I believe the proper action to unset is inline. This will remove the “Edit” bulk action, which is actually quick edit. <?php function remove_bulk_actions( $actions ){ unset( $actions[‘inline’] ); return $actions; } add_filter(‘bulk_actions-custom_post_type_slug’,’remove_bulk_actions’); ?> As for the Quick edit in each row, look into manage_{$post_type}_columns, as … Read more
Without doing Ajax (like in Quick Edit), the admin_url should be the very edit.php page. Note that: the filter post_row_actions takes two arguments, the second one being $post, so the global is not necessary. instead of using id as query argument, it’s best practice to use custom names, in this case update_id. I didn’t know … Read more
Why not just hide the column from view using CSS ? .column-yourcolumnname { display: none; }
You can get the ID per JavaScript from the quick edit screen’s parent tr: that has an attribute id=”edit-418″, where 418 is the post ID. So extract this number, get the post data per AJAX, and insert the values you need. Not elegant. Read wp-admin/js/inline-edit-post.js to see how the core does it.
I use this to add form fields to the quick edit. It’s not entirely easy to do this in WP (yet) and it can be very difficult to find info on how to do it. You have to really dig through the source to find it too. Add Form fields to Quick Edit <?php add_action(‘quick_edit_custom_box’, … Read more
There’s no hooks to modify the Quick Edit, it has to be done with CSS and/or jQuery. The plugin Adminimize is very good to hide administrative elements, CPTs included. But in the Quick Edit box, for lack of CSS classes or ID’s to target, it is not possible to hide the slug field, and only … Read more
Normally to add fields to the quick edit field, we should use ‘quick_edit_custom_box’ action hook that is triggered only for custom columns, because core columns are explicitly excluded (see code). If we add a custom column, then it will be shown in the list table, but it doesn’t make sense, because the column description is … 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
After adding our custom column, we are ready to expand our Post Quick Edit menu using the quick_edit_custom_box action hook. Note – The quick_edit_custom_box action hook will not fire unless there are custom columns present. That is why we started by adding a custom column. add_action(‘quick_edit_custom_box’, ‘shiba_add_quick_edit’, 10, 2); function shiba_add_quick_edit($column_name, $post_type) { if ($column_name … Read more