📜  工具集表单发布状态 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:25.244000             🧑  作者: Mango

代码示例2
add_action('cred_save_data', 'change_post_status',10,2);
function change_post_status($post_id, $form_data) {
 
if ($form_data['id']==9999){
$my_post['ID'] = $post_id;
$my_post['post_status'] = $_REQUEST['post_status'];
// Update the post into the database
wp_update_post( $my_post );
}
}