create_wpml_config.php

Download Link
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php error_reporting(1);
/**
 * This code will create a code for wpml-config.xml file.
 * Upload the file to wordpress root folder
 * Replace option_name in code below $get_array = get_option('option_name');
 * Then execute the file using http://yourdomainname.com/create_wpml_config.php
 * Copy the code to your wpml-config.xml file
 * Author: Harshad Mane
 * WPML.org
 */
?>
<?php
$option_name = $_GET['option_name'];
if($option_name){
require( './wp-load.php' );

/* Replace Option Name below */
$get_array = get_option($option_name);
echo '&lt;wpml-config&gt;'."<br>";
echo '&lt;admin-texts&gt;'."<br>";
echo '&lt;key name="'.$option_name.'"&gt;'."<br>";

foreach($get_array as $key => $value){
    if(is_array($value)){
		echo '&lt;key name="'.$key.'"&gt;'."<br>";
		foreach($value as $value1 => $value2)
		{
			if(is_array($value2)){
				echo '&lt;key name="'.$value1.'"&gt;'."<br>";
				foreach($value2 as $value3 => $value4)
				{
					echo '&lt;key name="'.$value3.'" /&gt;'."<br>";
				}
				echo '&lt;/key&gt;'."<br>";
			}
			else
			{
				echo '&lt;key name="'.$value1.'" /&gt;'."<br>";
			}
		}
		echo '&lt;/key&gt;'."<br>";
	}
	else
	{
		echo '&lt;key name="'.$key.'" /&gt;'."<br>";
	}
}
echo '&lt;/key&gt;'."<br>";
echo '&lt;/admin-texts&gt;'."<br>";
echo '&lt;/wpml-config&gt;';
}
else
{
echo "Please enter option name!!";
}
?>