I have custom Wordpress fields (I don't use ACF or any other plugin for this) and you need to translate them using qTranslate X to wp-admin.
The fields that I created using wp_editor work, but I don’t know how to make it work with the default value <input type="text">for the other custom fields that I have.
Below is a piece of code that I use to set a variable and show my field:
$services = isset( $values['services'] ) ? esc_attr( $values['services'][0] ) : '';
wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );
?>
<table>
<tr>
<td>
<input type="text" name="services_title" value="<?php echo !empty($services_title) ? $services_title : ''; ?>" style="width: 100%" />
</td>
</tr>
</table>
then I save it with:
add_action( 'save_post', 'hotelSaveData' );
function hotelSaveData( $post_id )
{
if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
if (isset($_POST['services_title']))
update_post_meta($post_id, 'services_title', wp_kses($_POST['services_title'], true));
}
Does anyone know how to make it work without using ACF or any other plugin? (My backup solution is to create other custom fields to save the data of another language, but solving it with qTranslate would be great)
thanks = D