Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick Edit displays error message #199

Closed
BevS opened this issue Jan 24, 2013 · 0 comments
Closed

Quick Edit displays error message #199

BevS opened this issue Jan 24, 2013 · 0 comments

Comments

@BevS
Copy link

BevS commented Jan 24, 2013

When using quick edit to publish a custom post type that uses meta-box, the error message "Are you sure you want to do this?Please try again." is displayed. This is due to the nonce check failing in inc/classes/meta-box.php function "save_post". The check fails because the nonce is not created for inline edits. Not only that, but the fields in memory are not filled in, so the save_post function should not do anything on inline-saves.

The solution is to edit the test in save_post to look like the following:
// Check whether:
// - the post is autosaved
// - the post is a revision
// - current post type is supported
// - user has proper capability
// - the edit is not inline
if (
( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
|| ( ! isset( $_POST['post_ID'] ) || $post_id != $_POST['post_ID'] )
|| ( ! in_array( $post_type, $this->meta_box['pages'] ) )
|| ( ! current_user_can( $post_type_object->cap->edit_post, $post_id ) )
|| ( $_POST['action'] == 'inline-save' )
)
{
return $post_id;
}

This thread may explain better:
http://wordpress.org/support/topic/quick-edit-not-working-and-problem-located?replies=4#post-3768402

rilwis added a commit that referenced this issue Jan 27, 2013
@rilwis rilwis closed this as completed Jan 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants