pustakakoran

Add Page Break button in WordPress Visual Editor

Feb 17th, 2018
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add this code in your theme/child theme functions.php. :
  2.  
  3. /* Add Page Break Button in First Row */
  4. add_filter( 'mce_buttons', 'my_add_page_break_button', 1, 2 ); // 1st row
  5.  
  6. /*Add Page Break button in WordPress Visual Editor */
  7. function my_add_page_break_button( $buttons, $id ){
  8.  
  9. /* Only add this for content editor */
  10. if ( 'content' != $id )
  11. return $buttons;
  12.  
  13. /* Add Page Break button after Insert Read More tag button */
  14. array_splice( $buttons, 13, 0, 'wp_page' );
  15.  
  16. return $buttons;
  17. }
RAW Paste Data