How to make Wordpress custom field input text translatable with qTranslate X? -
i have wordpress custom fields (i'm not using acf or other plugin this) , need translate them using qtranslate x in wp-admin.
the fields created wp_editor working, don't know how make work default <input type="text">
other custom fields have.
below, piece of code i'm using set variable , show 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'm saving with:
add_action( 'save_post', 'hotelsavedata' ); function hotelsavedata( $post_id ) { // bail if we're doing auto save 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 knows how make work, without using acf or other plugin ? (my fallback solution create custom fields save other language data, solve qtranslate great)
thanks =d
Comments
Post a Comment