-
-
Save meishern/fabd02a1491fad761fff to your computer and use it in GitHub Desktop.
Wordpress options table reader for serailized data for wpml plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 '<wpml-config>' . "<br />"; | |
echo '<admin-texts>' . "<br />"; | |
echo '<key name="' . $option_name . '">' . "<br />"; | |
foreach($get_array as $key => $value) { | |
if (is_array($value)) { | |
echo ' <key name="' . $key . '">' . "<br />"; | |
foreach($value as $value1 => $value2) { | |
if (is_array($value2)) { | |
echo ' <key name="' . $value1 . '">' . "<br />"; | |
foreach($value2 as $value3 => $value4) { | |
if (is_array($value4)) { | |
echo ' <key name="' . $value3 . '">' . "<br />"; | |
foreach($value4 as $value5 => $value6) { | |
echo ' <key name="' . $value5 . '" />' . "<br />"; | |
} | |
echo ' </key>' . "<br />"; | |
} else { echo ' <key name="' . $value3 . '" />' . "<br />";} | |
} | |
echo ' </key>' . "<br />"; | |
} else { echo ' <key name="' . $value1 . '" />' . "<br />";} | |
} | |
echo ' </key>' . "<br />"; | |
} else { echo ' <key name="' . $key . '" />' . "<br />";} | |
} | |
echo '</key>' . "<br />"; | |
echo '</admin-texts>' . "<br />"; | |
// echo '</wpml-config>'; | |
} | |
else { | |
echo "Please enter option name!!"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment