将此代码放入functions.php
. 它将在应用层服务之前过滤所有内容。
<?php
function filterContent($content)
{
$upateURL = array
(
\'http://www.example.com/wp-content/uploads\' => \'https://www.example.com/wp-content/uploads\',
);
foreach ($upateURL as $key => $value)
{
$content = str_replace($key, $value, $content);
}
return $content;
}
add_filter(\'the_content\', \'filterContent\');
?>