ACF_WPML_Compatibility::__construct() public ACF 3.1.8
Sets up the class functionality.
{} Это метод класса: ACF_WPML_Compatibility{}
Хуков нет.
Возвращает
null.
Использование
$ACF_WPML_Compatibility = new ACF_WPML_Compatibility(); $ACF_WPML_Compatibility->__construct();
- (void) (обязательный)
Список изменений
С версии 3.1.8 | Введена. |
Код ACF_WPML_Compatibility::__construct() ACF WPML Compatibility:: construct ACF 5.9.1
function __construct() {
// global
global $sitepress;
// update settings
acf_update_setting('default_language', $sitepress->get_default_language());
acf_update_setting('current_language', $sitepress->get_current_language());
// localize data
acf_localize_data(array(
'language' => $sitepress->get_current_language()
));
// switch lang during AJAX action
add_action('acf/verify_ajax', array($this, 'verify_ajax'));
// prevent 'acf-field' from being translated
add_filter('get_translatable_documents', array($this, 'get_translatable_documents'));
// check if 'acf-field-group' is translatable
if( $this->is_translatable() ) {
// actions
add_action('acf/upgrade_500_field_group', array($this, 'upgrade_500_field_group'), 10, 2);
add_action('icl_make_duplicate', array($this, 'icl_make_duplicate'), 10, 4);
// filters
add_filter('acf/settings/save_json', array($this, 'settings_save_json'));
add_filter('acf/settings/load_json', array($this, 'settings_load_json'));
}
}