__('Apply', 'acfe'), 'Close' => __('Close', 'acfe'), 'Update' => __('Update', 'acfe'), 'Read more' => __('Read more', 'acfe'), 'Details' => __('Details', 'acfe'), 'Debug' => __('Debug', 'acfe'), 'Local file is different from the version in database.' => __('Local file is different from the version in database.', 'acfe'), 'Do you want to replace the local file with the current settings?' => __('Do you want to replace the local file with the current settings?', 'acfe'), )); acf_localize_text($text); // data $data = apply_filters('acfe/localize_data', array( 'version' => ACFE_VERSION, 'home_url' => home_url(), 'is_admin' => is_admin(), 'is_user_logged_in' => is_user_logged_in(), )); // set data $this->set_data($data); // localize acfe_localize_data(); } /** * get_data * * @param $path * @param $default * * @return array|mixed|null */ function get_data($path = null, $default = null){ return !$path ? $this->data : acfe_get($this->data, $path, $default); } /** * set_data * * @param $path * @param $value * * @return void */ function set_data($path = null, $value = null){ if($value === null){ $value = $path; $path = null; } if(!$path){ $this->data = array_merge($this->data, $value); }else{ acfe_set($this->data, $path, $value); } } /** * unset_data * * @param $path * * @return void */ function unset_data($path = null){ if(!$path){ $this->data = array(); }else{ acfe_unset($this->data, $path); } } } acf_new_instance('acfe_assets'); endif; /** * acfe_localize_data * * @return void */ function acfe_localize_data(){ acf_localize_data(array('acfe' => acfe_get_localize_data())); } /** * acfe_get_localize_data * * @return array|false|string[] */ function acfe_get_localize_data($path = null, $default = null){ return acf_get_instance('acfe_assets')->get_data($path, $default); } /** * acfe_set_localize_data * * @param null $path * @param null $value */ function acfe_set_localize_data($path = null, $value = null){ acf_get_instance('acfe_assets')->set_data($path, $value); acfe_localize_data(); } /** * acfe_append_localize_data * * @param $path * @param $value * * @return void * * @deprecated */ function acfe_append_localize_data($path = null, $value = null){ acfe_deprecated_function('acfe_append_localize_data()', '0.9.0.5', 'acfe_set_localize_data()'); acfe_set_localize_data($path, $value); }