0

I am updating my post using below code:

$post_information = array(
    'ID' => $_REQUEST['ID'],
    'post_content' =>  $_REQUEST['content'],
    'post_status'  =>  'publish'
);
wp_update_post($post_information);  

But when I update my post, then it also make my post sticky, Please tell me how update my post whiteout making it sticky.

1 Answer 1

1

I need to add: post_date_gmt

$post_information = array(
    'ID' => $_REQUEST['ID'],
    'post_content' =>  $_REQUEST['content'],
    'post_status'  =>  'publish',
    'post_date_gmt' => $post->post_date_gmt
);
wp_update_post($post_information); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.