WordPress编辑器添加文章分页按钮的方法

不知道为什么Wordpress明明有文章分页功能,而编辑器却没有插入分页符的按钮,必须切换到文本模式输入才能插入分页。可以通过下面的代码在编辑器上添加一个分页符按钮。

将下面的代码添加到当前主题functions.php即可。

function mce_page_break($mce_buttons) {
$pos = array_search('wp_more', $mce_buttons, true);
if ($pos !== false) {
$buttons = array_slice($mce_buttons, 0, $pos + 1);
$buttons[] = 'wp_page';
$mce_buttons = array_merge($buttons, array_slice($mce_buttons, $pos + 1));
}
return $mce_buttons;
}
add_filter('mce_buttons', 'mce_page_break');
温馨提示:本文最后更新于2024-09-18 15:50:58,某些文章具有时效性,若有错误或已失效,请 联系我们 反馈。

👋 感谢您的观看!

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享