Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Wordpress options table reader for serailized data for wpml plugin
<?php
error_reporting(1);
/**
* This code will create a code for wpml-config.xml file.
* 1) Save the file and call it a.php
* 2) Upload the file to wordpress root folder (it should be in same folder as wp-config.php file and not in theme folder)
* 3) Then execute the file using http://your-domain.com/a.php?option_name=XXX
* Copy the code to line 2 of your wpml-config.xml file
* Author: Harshad Mane
* Modified t by Nick M. of kriesi.at support to include an additional layer in depth , layout for easier reading
* WPML.org
*/
?>
<?php
$option_name = $_GET['option_name'];
if ($option_name) {
require ('./wp-load.php');
$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 '&nbsp;&nbsp;&nbsp;&lt;key name="' . $key . '"&gt;' . "<br />";
foreach($value as $value1 => $value2) {
if (is_array($value2)) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;key name="' . $value1 . '"&gt;' . "<br />";
foreach($value2 as $value3 => $value4) {
if (is_array($value4)) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;key name="' . $value3 . '"&gt;' . "<br />";
foreach($value4 as $value5 => $value6) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;key name="' . $value5 . '" /&gt;' . "<br />";
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/key&gt;' . "<br />";
} else { echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;key name="' . $value3 . '" /&gt;' . "<br />";}
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/key&gt;' . "<br />";
} else { echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;key name="' . $value1 . '" /&gt;' . "<br />";}
}
echo '&nbsp;&nbsp;&nbsp;&lt;/key&gt;' . "<br />";
} else { echo '&nbsp;&nbsp;&nbsp;&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!!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.