How to manage saving custom field from Quick edit and Post Save using save_post action hook without colliding each other?
How to manage saving custom field from Quick edit and Post Save using save_post action hook without colliding each other?
How to manage saving custom field from Quick edit and Post Save using save_post action hook without colliding each other?
You can add the following code in function.php $subscriber= get_role(‘subscriber’); $subscriber->add_cap(‘edit_comment’); Meanwhile edit_comment is only supported in version 3.1 or newer Or you can use this plugin link
Sorry, I’ve had to change my answer after checking the WordPress Codex on adding custom editable data to the quick edit. So you’ll have to remove the references to $post_id too (from the add_action arguments and from within your function). It looks like the quick_edit_custom_box only takes 2 arguments: $column_name and $post_type. Then for getting … Read more
There are a few steps to create the custom quick edit box and custom column create a custom meta key (assumed that you have 1 already) add custom admin column title and data (assumed that you want to shows the custom meta key in the column, if not, you may also modify a bit of … Read more
Why the headline_news meta data is deleted on the Edit Post screen, with a fix The qedit_save_post() function stomps on headline_news because $_POST[‘headline_news’] is not set when using the post edit screen. Since the custom fields editor is being used for headline_news and there is no custom meta box involved, we’ll let the built-in custom … Read more
I think the action wp_ajax_get-comments is not triggered, if you quick-update the comment. You should check, which ajax request is triggered on the update and then change your code into: if( doing_action( ‘wp_ajax_get-comments’ ) || doing_action( ‘wp_ajax_quick-update-action’ ) ){ … } I am not able to test this code at the moment, but i hope … Read more
Answer remade. The original was a wild idea… The solution is the same as the one posted by Rarst in the question linked How to *remove* a parent theme page template from a child theme? Difference being the admin_head hook. And a check for only running in edit-page and not in edit-post or edit-custom_post_type, as … Read more
We have to intercept the Ajax end point of that action. The file wp-admin/admin-ajax.php has all the possible hooks in the $core_actions_post array. The function wpse_65157_ajax_inline_save() is a copy of the Core’s, with a “force reload” script printed at the end. It has to be with Javascript, as wp_redirect() doesn’t work. add_action( ‘wp_ajax_inline-save’, ‘wpse_65157_ajax_inline_save’ , … Read more
A small example from my last project. The important part is the hook quick_edit_custom_box. On this hook can you add your form elements. The second important part is to add your script that update the data via javascript. The script in this example was add to the head in edit.php; it is better on footer … Read more
Answering this Question, came to a jQuery solution to Ana Ban’s one. add_action( ‘admin_head’, ‘wpse_56551_script_enqueuer’ ); function wpse_56551_script_enqueuer() { global $current_screen; /** /wp-admin/edit.php?post_type=post /wp-admin/edit.php?post_type=page /wp-admin/edit.php?post_type=cpt == gallery in this example */ if( ‘edit-gallery’ == $current_screen->id ) { ?> <script type=”text/javascript”> jQuery(document).ready( function($) { $(“a.editinline”).live(“click”, function () { var ilc_qe_id = inlineEditPost.getId(this); setTimeout(function() { $(‘#edit-‘+ilc_qe_id+’ select[name=”_status”] … Read more