对
使用mce_buttons_2
筛选以将按钮添加到第二行使用mce_buttons_3
筛选以将按钮添加到第三行以下是我使用的示例:
function mytheme_mce_buttons_row_3($buttons) {
$buttons[] = \'fontselect\';
$buttons[] = \'fontsizeselect\';
$buttons[] = \'code\';
$buttons[] = \'sup\';
$buttons[] = \'sub\';
$buttons[] = \'backcolor\';
$buttons[] = \'separator\';
$buttons[] = \'hr\';
$buttons[] = \'wp_page\';
return $buttons;
}
add_filter("mce_buttons_3", "mytheme_mce_buttons_row_3");
把这个放在函数中就行了。php。(我把它放在我的主题设置函数中
after_setup_theme
.)
编辑:
我不知道这是否有区别,但你正在使用array_push($buttons, $button)
, 当我使用$buttons[] = $button
以下是您的代码:
//setup array of shortcode buttons to add
function register_button_3($buttons) {
array_push($buttons, "dropcap");
array_push($buttons, "divider");
array_push($buttons, "quote");
array_push($buttons, "pullquoteleft");
array_push($buttons, "pullquoteright");
array_push($buttons, "boxdark");
array_push($buttons, "boxlight");
array_push($buttons, "togglesimple");
array_push($buttons, "togglebox");
array_push($buttons, "tabs");
array_push($buttons, "signoff");
array_push($buttons, "columns");
array_push($buttons, "smallbuttons");
array_push($buttons, "largebuttons");
array_push($buttons, "lists");
return $buttons;
}
add_filter(\'mce_buttons_3\', \'register_button_3\');
使用我的方法,看起来是这样的:
//setup array of shortcode buttons to add
function register_button_3($buttons) {
$buttons[] = \'dropcap\';
$buttons[] = \'divider\';
$buttons[] = \'quote\';
$buttons[] = \'pullquoteleft\';
$buttons[] = \'pullquoteright\';
$buttons[] = \'boxdark\';
$buttons[] = \'boxlight\';
$buttons[] = \'togglesimple\';
$buttons[] = \'togglebox\';
$buttons[] = \'tabs\';
$buttons[] = \'signoff\';
$buttons[] = \'columns\';
$buttons[] = \'smallbuttons\';
$buttons[] = \'largebuttons\';
$buttons[] = \'lists\';
return $buttons;
}
add_filter(\'mce_buttons_3\', \'register_button_3\');
试试看?