去除<br/>及<p></p>的自動轉換
1. 安裝 Text Control 插件。
2. 修改 wp-includes/js/tinymce/tiny_mce_config.php
// TinyMCE init settings
$initArray = array (
 'mode' => 'none',
 'onpageload' => 'wpEditorInit',
 'width' => '100%',
修改成
// TinyMCE init settings
$initArray = array (
 'forced_root_block' => false,
 'force_br_newlines' => false,
 'force_p_newlines' => false,
 'mode' => 'none',
 'onpageload' => 'wpEditorInit',
 'width' => '100%',
去除 & 的自動轉換
2. 修改 wp-includes/formatting.php
第一個部份
        $curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl);
        $output .= $curl;
    }
    return $output;
修改成
//      $curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl);
        $output .= $curl;
    }
    return $output;
第二個部份
    // Remove metadata tags
    $content = preg_replace('/(.+?)<\/title>/','',$content);
    $content = preg_replace('/(.+?)<\/category>/','',$content);
    // Converts lone & characters into & (a.k.a. &)
    $content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content);
修改成
    // Remove metadata tags
    $content = preg_replace('/(.+?)<\/title>/','',$content);
    $content = preg_replace('/(.+?)<\/category>/','',$content);
    // Converts lone & characters into & (a.k.a. &)
//  $content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content);
 
張貼留言