
お役立ち記事・ブログ
8月のWordpressが4.3にバージョンアップしましたが、そのあと投稿画面で「ビジュアル」や「テキスト」のタブでモードを切り替えようとしても切り替わらないという現象が発生しました。
原因ですが、PS Disable Auto Formattingという自動整形を制御するプラグインのようです。
いろいろと調べると、PS Disable Auto Formattingのソースをカスタマイズするという方法もあるようですが、このプラグイン自体の更新が止まっているようですので、今後のリスクも考えてPS Disable Auto Formattingの利用を停止することにしました。
そのままですと、ビジュアルモードとテキストモードを切り替えた時にpタグやbrタグが削除されるという現象が発生しますので、Tiny MCE Advancedというプラグインの設定画面で、
Stop removing the <p> and <br /> tags when saving and show them in the Text editor
という項目のチェックをすることで回避できます。
ただ、PS Disable Auto Formattingは記事表示のときにもいろいろとタグの調整を行っているようですので、もし停止すると表示崩れが発生する場合は、上記のの設定を行いつつ、PS Disable Auto Formattingのプラグインファイルps_disable_auto_formatting.phpの
add_filter( ‘print_scripts_array’, array( $this, ‘rewrite_default_script’ ) );
の部分をコメントアウトすることでモード切り替えが可能となります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function __construct() { global $wp_version; if ( version_compare( $wp_version, '2.5', '>=' ) ) { add_action( 'init' , array( $this, 'disable_auto_formatting_init' ) ); add_action( 'admin_menu', array( $this, 'add_disable_formatting_setting_page') ); //add_filter( 'print_scripts_array', array( $this, 'rewrite_default_script' ) ); add_filter( 'wp_insert_post_data', array( $this, 'formatting_quickpress_post' ) ); add_action( 'media_buttons', array( $this, 'check_edit_mode_and_add_richedit_pre' ), 9 ); add_action( 'media_buttons', array( $this, 'delete_filtering_wp_richedit_pre' ) ); } else { add_action('admin_notices' , array( $this, 'version_too_old' ) ); } } |
ホームページ・ポータルサイト制作、起業支援に関することはお気軽にご相談・お問い合わせください
TEL:050-3152-1848
電話受付時間:平日9:30~18:30
メールでのお問い合わせは24時間受付OK!(無料)
メール受付はコチラ