最合适的回答,由SO网友:Louis D. 整理而成
可以使用maybe_unserialize(get_theme_mods())
和get_theme_mod()
WP功能并遵循以下步骤:
在WP安装的根文件夹中创建一个php文件(路径与wp-load.php
).插入以下代码:
require_once("wp-load.php");
$r = maybe_unserialize(get_theme_mods());
foreach ($r as $k => $v){
if(!empty($k)){
$ListOptions[] = $k;
}
}
foreach($ListOptions as $option){
$str = get_theme_mod($option);
$str = str_replace(\'http://localhost\', \'https://mywebsite.com\', $str);
$str = str_replace(\'http:\\\\/\\\\/localhost\', \'https:\\\\/\\\\/mediadroit.fr\', $str);
set_theme_mod($option, $str);
var_dump(\'|\'.$option.\': \'.get_theme_mod($option).\' ===> \'.$str);
echo "\\n";
}
<执行脚本