I have an active website hidden link where the user can create and edit house properties via front end.
When I created, after some changes in functions.php all works good.
I used the follow code:
add_action('cred_save_data', 'change_post_status',10,2);
function change_post_status($post_id, $form_data) {
if ($form_data['id']==1062 /*That's my edit cred form*/){
$my_post['ID'] = $post_id;
$my_post['post_status'] = $_REQUEST['my_post_status'];
// Update the post into the database
wp_update_post( $my_post );
}
}
function func_get_post_status() {
$post_id = $_GET['_id'];
$x = get_post_status($post_id);
return '<input type="hidden" id="sel_post_status_value" name="sel_post_status_value" value="'.$x.'" />';
}
add_shortcode( 'get_current_post_status', 'func_get_post_status');
/**
*Duplicate Content on submit of Original to all secondary langs (for translation)
*/
function quick_duplicate_save_data_action( $post_id, $form_data ){
// Change your CRED Form "ID" accordingly below
if ($form_data['id']==768 /*That's my cred form which creates properties*/){
// Use new WPML API
do_action( 'wpml_admin_make_post_duplicates', $post_id ) ;
}
}
add_action( 'cred_save_data', 'quick_duplicate_save_data_action', 10, 2 );
All that code was added to functions with technical support help.
In edit properties cred form I have an jquery code to obtain x, but now that code appears black (as not active).
Two or three weeks ago, after some toolset and wpml update, when I edit a default language property, all the translated properties join to this turns into default language.
I added two photos. When you enter with user and password, you can see all properties list (foto1) and view or edit all the properties (foto2).
Before plugin updates, after creates a new propertie, my user just have to change menu language and edit.
Now my problem is that is they edit default language and save, all the translations disappears and the translated post turns into default language.
Can you help me?