get_default_language(); $active_to = $acfwpmloptions['acf_wpml_to_active_post']; if($current_lang != $default_lang) { $tr_active_to = $wpdb->get_var("SELECT trid FROM {$wpdb->prefix}icl_translations WHERE element_id={$active_to} AND language_code='{$default_lang}'"); $tr_active_to = $wpdb->get_var("SELECT element_id FROM {$wpdb->prefix}icl_translations WHERE trid={$tr_active_to} AND language_code='{$current_lang}'"); if($tr_active_to) { $active_to = $tr_active_to; } else { $active_to = $active_to; } } return get_field($option, $active_to); } //Shortcode version function get_field_option_shortcode($atts=null, $content=null) { $atts = shortcode_atts( array( 'option' => '', ), $atts ); return get_field_option($atts['option']); } add_shortcode('get_field_option', 'get_field_option_shortcode'); //Cleanup database after deletion register_uninstall_hook(__FILE__, 'acf_wpml_to_uninstall'); } } else { // Check what requisites require_once(acfwpmlpath.'/globals/controllers/reqs.class.php'); } ?>