WordPress 4.3で導入された書式設定のショートカットがお嫌いですか?ちょっと邪魔だと感じますか?最近、あるユーザーからWordPressのビジュアルエディターフォーマットショートカットを無効化する方法を尋ねられました。この投稿では、WordPress 4.3でビジュアルエディターのショートカットを無効化する方法をご紹介します。
書式設定ショートカットとは?
WordPress 4.3には、書式設定ショートカットという新機能が追加されました。これにより、ユーザーはキーボードから手を離すことなく、またHTMLを記述することなく、一般的なテキストフォーマットを素早く追加することができます。
- または-を使用すると、順序なしリストが開始されます。
- または1)を使用すると、順序付きリストが開始されます。
- を使うとh1に変換されます。h2は##、h3は###といった具合。
- を使うとblockquoteになります。
動画チュートリアル
動画が気に入らなかったり、もっと説明が必要な場合は、このまま読み進めてください。
ビジュアルエディターフォーマットショートカットの無効化
書式設定のショートカットは素晴らしい機能ですが、一部のユーザーはこの機能が少し分かりづらく、邪魔だと感じているようです。
WordPressの書式設定ショートカットを無効化したい場合は、以下の手順に従ってください:
このコードをテーマのfunctions.phpファイルまたはサイト固有のプラグインにコピー&ペーストしてください。
[cbk1]
このコードは、WordPressビジュアルエディターからテキストフォーマットショートカットを削除します。他のWordPressキーボードショートカットは通常通り機能します。
この投稿が WordPress 4.3 以降のバージョンでビジュアルエディターの書式設定ショートカットを無効化するのにお役に立てば幸いです。WordPressビジュアルエディターを使いこなすための14のヒントもご覧ください。
この投稿が気に入った場合は、WordPressの動画チュートリアルをYouTubeチャンネルに登録してください。Twitterや Facebookでもご覧いただけます。
Syed Balkhi
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Rudy
Excellent, and thank you! I am going to use this in our numerous WordPress installations. It’s a bit awkward to do it in each theme, but since we use child themes exclusively, it should be a one-time edit. Our staff will be pleased to know these ridiculous shortcuts are going to be disabled.
Rudy
Actually, it was easier to do this as a plugin, as I can then deploy it in multisite to all sites in a network. Tested and working fine. Thanks again!
Bill
Awesome, thanks!
Palla Sridhar
Hello.
I have a different problem. I’m trying to add “schema markup” code in Text editor of WordPress post. But when I save it in Text view and go to Visual tab, its getting deleted. Is there a solution for this kind of problem.?
WPBeginner Support
You will have to write it in text editor. Visual editor uses several functions to sanitize the code used by a user in posts.
管理者
Trish
Thanks for this. I haven’t upgraded yet but I have very specific requirements for my list formatting and the shortcuts would interfere with this.
Adrienne
I love the shortcuts….. makes it fast and easy then going into the text editor and adding all the time.