but how can I pass the post id ?
add_action('frm_after_update_entry', 'update_post_statusr', 10, 2);
function update_post_statusr($entry_id, $form_id){
if ( $form_id == 2 ) {
$postid = $_POST['item_meta'][?];//
$status = $_POST['item_meta'][10];//
$my_post = array(
'ID' => $postid,
'post_status' => $status,
);
wp_update_post( $my_post );
}
}
You need to retrieve the post ID from the entry or examine the contents of the PHP $_POST associative array to see if its available there.
Please login or Register to submit your answer