如何在WordPress 4.3中禁用可视化编辑器格式的快捷方式

Don’t like the formatting shortcuts that were introduced in WordPress 4.3? Find it a bit distracting? Recently, one of our users asked us how to disable visual editor formatting shortcuts in WordPress. In this article, we will show you how to disable visual editor formatting shortcuts in WordPress 4.3.

不喜欢WordPress 4.3中引入的格式化快捷方式吗? 觉得有点分心? 最近,我们的一位用户问我们如何在WordPress中禁用可视化编辑器格式的快捷方式。 在本文中,我们将向您展示如何在WordPress 4.3中禁用可视化编辑器格式的快捷方式。

Formatting shortcuts in WordPress visual editor
什么是格式化快捷方式以及如何使用它们? (What are Formatting Shortcuts and How to Use Them?)

WordPress 4.3 came with a new feature called formatting shortcuts. It allows users to quickly add common text formatting without removing their hands from the keyboard and without writing any HTML.

WordPress 4.3附带了一项称为格式化快捷方式的新功能。 它使用户可以快速添加常用的文本格式,而无需从键盘上移开手并且无需编写任何HTML。

  • * or * will start an unordered list.将启动无序列表。
  • 1. or 1.1) will start an ordered list.1)将启动一个有序列表。
  • # will transform into h1. 将转换为h1。 ## for h2, ##代表h2, ### for h3 and so on.###代表h3,依此类推。
  • > will transform into blockquote.>将转换为blockquote。

Editor shortcuts
影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

禁用Visual Editor格式化快捷方式 (Disabling Visual Editor Formatting Shortcuts)

While we think that formatting shortcuts are awesome, some users are finding this feature a bit confusing and distracting.

虽然我们认为格式化快捷键很棒,但是一些用户发现此功能有点混乱和分散注意力。

If you want to disable the formatting shortcuts in WordPress, then follow the instructions below:

如果要禁用WordPress中的格式设置快捷方式,请按照以下说明进行操作:

Copy and paste this code in your theme’s functions.php file or in a site-specific plugin.

将此代码复制并粘贴到主题的functions.php文件或特定站点的插件中


function disable_mce_wptextpattern( $opt ) {

	if ( isset( $opt['plugins'] ) && $opt['plugins'] ) {
		$opt['plugins'] = explode( ',', $opt['plugins'] );
		$opt['plugins'] = array_diff( $opt['plugins'] , array( 'wptextpattern' ) );
		$opt['plugins'] = implode( ',', $opt['plugins'] );
	}

	return $opt;
}

add_filter( 'tiny_mce_before_init', 'disable_mce_wptextpattern' );

This code simply removes text formatting shortcuts from your WordPress visual editor. Your other WordPress keyboard shortcuts will work as usual.

此代码仅从WordPress可视编辑器中删除文本格式快捷方式。 您的其他WordPress键盘快捷键将照常工作。

We hope this article helped you disable visual editor formatting shortcuts in WordPress 4.3 and later versions. You may also want to see these 14 tips for mastering the WordPress visual editor.

我们希望本文能帮助您禁用WordPress 4.3及更高版本中的可视化编辑器格式化快捷方式。 您可能还希望了解掌握WordPress可视编辑器的14条技巧

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-disable-visual-editor-formatting-shortcuts-in-wordpress-4-3/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值