I’m adding some features to the quck edit area of wordpress. I have everything working except updating post_content. I am able to update the meta values using update_post_meta, but the method I’m using to update post_content just causes the infinite spinning wheel.
function min_max_step_desc_quick_edit_save( $post_id, $post ){
// check inlint edit nonce
if ( ! wp_verify_nonce( $_POST[ '_inline_edit' ], 'inlineeditnonce' ) ) {
return;
}
// update the price
$min = ! empty( $_POST[ 'min' ] ) ? absint( $_POST[ 'min' ] ) : '';
update_post_meta( $post_id, '_alg_wc_pq_min', $min );
$max = ! empty( $_POST[ 'max' ] ) ? absint( $_POST[ 'max' ] ) : '';
update_post_meta( $post_id, '_alg_wc_pq_max', $max );
$step = ! empty( $_POST[ 'step' ] ) ? absint( $_POST[ 'step' ] ) : '';
update_post_meta( $post_id, '_alg_wc_pq_step', $step );
$desc = ! empty( $_POST[ 'desc' ] ) ? absint( $_POST[ 'desc' ] ) : '';
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_content'] = $desc;
wp_update_post( $my_post );
}
2
Answers
Try to reduce the error by doing the following:
As this is for WooCommerce Products Quick Edit, you can use the following instead:
It should work.