Skip to content

Instantly share code, notes, and snippets.

@spencejs
Created June 11, 2013 20:30
Show Gist options
  • Save spencejs/5760370 to your computer and use it in GitHub Desktop.
Save spencejs/5760370 to your computer and use it in GitHub Desktop.
Add NextPage and Other Buttons to TinyMCE
//Add NextPage and Other Buttons to TinyMCE
add_filter('mce_buttons', function ($mce_buttons) {
$pos = array_search('wp_more', $mce_buttons, true);
if ($pos !== false) {
$buttons = array_slice($mce_buttons, 0, $pos + 1);
$buttons[] = 'wp_page';
$buttons[] = 'hr';
$mce_buttons = array_merge($buttons, array_slice($mce_buttons, $pos + 1));
}
return $mce_buttons;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment