问题是你有太多的按钮。。。
我创建的插件也有同样的问题,但我只有21个按钮,而你有41个按钮。。。
解决方案是将它们分成两部分:将前20个按钮添加到第三行(mce\\U buttons\\U 3),然后将21个按钮添加到第四行(mce\\U buttons\\U 4)
您需要为每一行创建一个函数。。。
代码如下所示:
add_action(\'init\', \'add_button\');
add_action(\'init\', \'add_button2\');
function add_button() {
if ( current_user_can(\'edit_posts\') && current_user_can(\'edit_pages\') )
{
add_filter(\'mce_external_plugins\', \'add_plugin\');
add_filter(\'mce_buttons_3\', \'register_button\');
}
}
function add_button2() {
if ( current_user_can(\'edit_posts\') && current_user_can(\'edit_pages\') )
{
add_filter(\'mce_external_plugins\', \'add_plugin2\');
add_filter(\'mce_buttons_4\', \'register_button2\');
}
}
function register_button($buttons) {
array_push($buttons, "quote", "one-fourth", "one-fourth-last", "one-third", "one-third-last", "one-half", "one-half-last", "two-third", "two-third-last", "three-fourth", "three-fourth-last", "custom-list-1", "custom-list-2", "custom-list-3", "custom-list-4", "message-box-info", "message-box-success", "message-box-warning", "message-box-erroneous", "message-box-simple" );
return $buttons;
}
function register_button2($buttons) {
array_push($buttons, "message-box-custom", "recent-posts", "custom-frame-left", "custom-frame-center", "custom-frame-right", "custom-table", "accordion", "accordion-toggle", "tabs", "tabs-content", "toggle-content", "dropcap", "pull-quote", "clear", "divider", "divider-top", "custom-button", "round-button", "small-button", "button", "read-more" );
return $buttons;
}
当然,您还必须创建“add\\u plugin”和“add\\u plugin2”函数。。。
我希望这有助于。。。