WordPress 4.3 的可视化编辑器下新增了格式化快捷键功能,让你可以很方便撰写文章,有点类似于 Markdown 语法。目前 WordPress 支持以下快捷键:
- 输入 * 或 – 回车后可以添加无序列表
- 输入1. 或 1) 回车后可以添加有序列表
- 输入 # 回车后将插入一级标题 h1, ## 二级标题 h2,### 三级标题 h3 等等
- 输入 > 回车后将插入一个引用模块
这个格式化快捷键应该是可以提高书写速度的,但是可能有些朋友不太习惯,而且可能会干扰输入,那么你可以将下面的代码添加到主题的 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' ); |
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' );
代码出自:https://wordpress.org/support/topic/wordpress-43-how-to-disable-formatting-shortcuts#post-7318451
来源:
https://www.wpdaxue.com/wordpress-4-3-disable-formatting-shortcuts.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32385.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57