Skip Navigation

[Resolved] Post Status Cred Change

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by tammot 6 years, 10 months ago.

Author
Posts
#604583

I am trying to:

change post status from draft to publish/ publish to draft on front end edit form

This is the function I was using but it stopped working. Any ideas?

/***POST STATUS CRED CHANGE***/

add_action('cred_save_data_33', 'Select_Post_Status_func',10,2);
function Select_Post_Status_func($post_id) {
$my_post['ID'] = $post_id;
$my_post['post_status'] = $_REQUEST['post_status'];
// Update the post into the database
wp_update_post( $my_post );
}

#604584

I figured it out!

#924597

Great. How did you do that?

TIA,

Tammo