diff --git a/inc/classes/meta-box.php b/inc/classes/meta-box.php index dcaca4759..14f84b7ee 100644 --- a/inc/classes/meta-box.php +++ b/inc/classes/meta-box.php @@ -265,9 +265,7 @@ public function show() $classes[] = $field['class']; printf( - $field['before'] . - '
%s
' . - $field['after'], + $field['before'] . '
%s
' . $field['after'], implode( ' ', $classes ), $group, $html @@ -401,7 +399,7 @@ static function meta( $meta, $post_id, $saved, $field ) * * @param int $post_id Post ID * - * @return int|void + * @return void */ function save_post( $post_id ) { @@ -421,22 +419,24 @@ function save_post( $post_id ) // - the post is a revision // - current post type is supported // - user has proper capability + // - in Quick edit mode, @link http://wordpress.org/support/topic/quick-edit-not-working-and-problem-located 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 ) ) + || ( 'inline-save' == $_POST['action'] ) ) { - return $post_id; + return; } // Verify nonce check_admin_referer( "rwmb-save-{$this->meta_box['id']}", "nonce_{$this->meta_box['id']}" ); - + //Save post action removed to prevent infinite loops remove_action( 'save_post', array( $this, 'save_post' ) ); - + //Before save actions do_action("rwmb_before_save_post", $post_id); do_action("rwmb_{$this->meta_box['id']}_before_save_post", $post_id); @@ -460,11 +460,11 @@ function save_post( $post_id ) // Call defined method to save meta value, if there's no methods, call common one self::do_field_class_actions( $field, 'save', $new, $old, $post_id ); } - + //After save sctions do_action("rwmb_after_save_post", $post_id); do_action("rwmb_{$this->meta_box['id']}_after_save_post", $post_id); - + //Reinstate save_post action add_action( 'save_post', array( $this, 'save_post' ) ); }