Hi!
I had an active website that have a problem with a cred generic field.
Time ago, with your help, i create a cred generic field to user can't change frontend the post status.
The function code it's:
function change_post_status($post_id, $form_data) {
if ($form_data['id']==1062){
$my_post['ID'] = $post_id;
$my_post['post_status'] = $_REQUEST['my_post_status'];
// Update the post into the database
wp_update_post( $my_post );
}
}
And in my cred form i have:
[cred_generic_field field='my_post_status' type='select' class='' urlparam='']
{
"required":0,
"validate_format":0,
"persist":1,
"default":["publish"],
"options":[{"value":"draft","label":"No activada"},{"value":"publish","label":"Activada"}]
}
[/cred_generic_field]
My problem happens when the user/admin changes the post status in WPML base language, it change the post status, but I want this option changes the post status for all the languages (my base language is catalan, but website have english, french and spanish languages too).
Are independent posts created via post form and a function.
But the cred generic field is the same used in all the languages. I want to know if there is a way to change the cred generic field database value for all languages.