这里是WP本地文章的作者。这通常是因为其他插件错误地混淆了标签,并阻止它设置正确的URL。如果您将下面的代码另存为一个单独的文件,请将其作为插件上载并激活,这样应该可以修复它。
<?php
/**
* Plugin Name: WPNA Editor Fix
* Description: Fix the base URL meta field that other plugins break.
* Author: OzTheGreat (WPArtisan)
* Author URI: https://wpartisan.me
* Version: 1.0.1
* Plugin URI: https://wp-native-articles.com
*
* @package wpna-editor-fix
*/
add_action( \'admin_footer-post.php\', \'wpna_custom_fix_base_url\' );
add_action( \'admin_footer-post-new.php\', \'wpna_custom_fix_base_url\' );
function wpna_custom_fix_base_url(){
?>
<script>
if ( window.history.replaceState ) {
var bases = document.getElementsByTagName(\'base\');
if (bases.length > 0) {
bases[0].href = document.getElementById( \'wp-admin-canonical\' ).href + window.location.hash;
}
}
</script>
<?php
}