public function validate_language_domain_action()
 {
     $response = false;
     $language_domains_helper = new WPML_Language_Domains($this->sitepress);
     $posted_url = filter_input(INPUT_POST, 'url');
     $nonce = filter_input(INPUT_POST, 'nonce');
     $action = filter_input(INPUT_POST, 'action');
     $is_valid_nonce = wp_verify_nonce($nonce, $action);
     if ($is_valid_nonce) {
         $is_valid = $language_domains_helper->validate_domain_networking($posted_url);
         $response = json_encode($is_valid);
     }
     if ($response) {
         wp_send_json_success(__('Valid', 'sitepress'));
     } else {
         wp_send_json_error(__('Not valid', 'sitepress'));
     }
     //		header( 'content-type: text/javascript; charset=utf-8' );
     //		header( 'access-control-allow-origin: *' );
     //		echo htmlspecialchars( $_GET['callback'] ) . '(' . $response . ')';
     //		exit;
 }
     $iclsettings['sync_comment_status'] = @intval($_POST['icl_sync_comment_status']);
     $iclsettings['sync_ping_status'] = @intval($_POST['icl_sync_ping_status']);
     $iclsettings['sync_sticky_flag'] = @intval($_POST['icl_sync_sticky_flag']);
     $iclsettings['sync_password'] = @intval($_POST['icl_sync_password']);
     $iclsettings['sync_private_flag'] = @intval($_POST['icl_sync_private_flag']);
     $iclsettings['sync_post_format'] = @intval($_POST['icl_sync_post_format']);
     $iclsettings['sync_delete'] = @intval($_POST['icl_sync_delete']);
     $iclsettings['sync_delete_tax'] = @intval($_POST['icl_sync_delete_tax']);
     $iclsettings['sync_post_taxonomies'] = @intval($_POST['icl_sync_post_taxonomies']);
     $iclsettings['sync_post_date'] = @intval($_POST['icl_sync_post_date']);
     $iclsettings['sync_comments_on_duplicates'] = @intval($_POST['icl_sync_comments_on_duplicates']);
     $this->save_settings($iclsettings);
     echo 1;
     break;
 case 'language_domains':
     $language_domains_helper = new WPML_Language_Domains($this);
     echo $language_domains_helper->render_domains_options();
     break;
 case 'icl_theme_localization_type':
     $icl_tl_type = @intval($_POST['icl_theme_localization_type']);
     $iclsettings['theme_localization_type'] = $icl_tl_type;
     $iclsettings['theme_localization_load_textdomain'] = @intval($_POST['icl_theme_localization_load_td']);
     $filtered_textdomain_value = filter_input(INPUT_POST, 'textdomain_value', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_NULL_ON_FAILURE);
     $iclsettings['gettext_theme_domain_name'] = $filtered_textdomain_value;
     if ($icl_tl_type == 1) {
         do_action('wpml_scan_theme_for_strings', true);
     } elseif ($icl_tl_type == 2) {
         $parent_theme = get_template_directory();
         $child_theme = get_stylesheet_directory();
         $languages_folders = array();
         if ($found_folder = icl_tf_determine_mo_folder($parent_theme)) {
Exemple #3
0
     $iclsettings['sync_private_flag'] = @intval($_POST['icl_sync_private_flag']);
     $iclsettings['sync_post_format'] = @intval($_POST['icl_sync_post_format']);
     $iclsettings['sync_delete'] = @intval($_POST['icl_sync_delete']);
     $iclsettings['sync_delete_tax'] = @intval($_POST['icl_sync_delete_tax']);
     $iclsettings['sync_post_taxonomies'] = @intval($_POST['icl_sync_post_taxonomies']);
     $iclsettings['sync_post_date'] = @intval($_POST['icl_sync_post_date']);
     $iclsettings['sync_comments_on_duplicates'] = @intval($_POST['icl_sync_comments_on_duplicates']);
     $this->save_settings($iclsettings);
     echo 1;
     break;
 case 'language_domains':
     $language_domains_helper = new WPML_Language_Domains($default_language, $iclsettings);
     echo $language_domains_helper->render_domains_options();
     break;
 case 'validate_language_domain':
     $language_domains_helper = new WPML_Language_Domains($default_language, $iclsettings);
     $posted_url = filter_input(INPUT_POST, 'url');
     echo $language_domains_helper->validate_domain_networking($posted_url);
     break;
 case 'icl_theme_localization_type':
     $icl_tl_type = @intval($_POST['icl_theme_localization_type']);
     $iclsettings['theme_localization_type'] = $icl_tl_type;
     $iclsettings['theme_localization_load_textdomain'] = @intval($_POST['icl_theme_localization_load_td']);
     $filtered_textdomain_value = filter_input(INPUT_POST, 'textdomain_value', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_NULL_ON_FAILURE);
     $iclsettings['gettext_theme_domain_name'] = $filtered_textdomain_value;
     if ($icl_tl_type == 1) {
         do_action('wpml_scan_theme_for_strings', true);
     } elseif ($icl_tl_type == 2) {
         $parent_theme = get_template_directory();
         $child_theme = get_stylesheet_directory();
         $languages_folders = array();