Fixed: error saving BSM keys

Fixed: issue of saving Wordfence key
Fixed: issue of overwrite php error config
Fixed: issue of a big child plugin option value
Fixed: error get update info of some premium plugin
Fixed: error for logging reports update post
This commit is contained in:
thanghv 2020-02-25 19:41:28 +07:00
parent fbc6ad0fb8
commit 927b138610
4 changed files with 106 additions and 21 deletions

View file

@ -563,7 +563,7 @@ class MainWP_Helper {
//Save the post to the wp
remove_filter( 'content_save_pre', 'wp_filter_post_kses' ); // to fix brake scripts or html
$post_status = $new_post['post_status'];
$new_post['post_status'] = 'auto-draft';
$new_post['post_status'] = 'auto-draft'; // child reports: to logging as created post
// update post
if ( $edit_post_id ) {
@ -572,6 +572,7 @@ class MainWP_Helper {
if ( $current_post && ( ( !isset( $new_post['post_type'] ) && $current_post->post_type == 'post' ) || ( isset( $new_post['post_type'] ) && $new_post['post_type'] == $current_post->post_type ) ) ) {
$new_post['ID'] = $edit_post_id;
}
$new_post['post_status'] = $post_status; // child reports: to logging as update post
}
$new_post_id = wp_insert_post( $new_post, $wp_error );
@ -584,6 +585,7 @@ class MainWP_Helper {
return array( 'error' => 'Empty post id');
}
if ( !$edit_post_id )
wp_update_post( array( 'ID' => $new_post_id, 'post_status' => $post_status ) );
if ( ! empty( $terms ) ) {