Add paging buttons to the WordPress editor

WordPress five 1.9K Reading mode

WordPress body has paging function, but there is no paging button in the editor. We can easily add a paging button through the following code.

 Add paging buttons to the WordPress editor

Add the following code to the functions.php file of your current theme:

  1. add_filter('mce_buttons','wysiwyg_editor');
  2.  
  3. function  wysiwyg_editor( $mce_buttons ) {
  4.      $pos  =  array_search ('wp_more', $mce_buttons ,true);
  5.      if  ( $pos  !==  false) {
  6.          $tmp_buttons  =  array_slice ( $mce_buttons , 0,  $pos +1);
  7.          $tmp_buttons [] = 'wp_page';
  8.          $mce_buttons  =  array_merge ( $tmp_buttons array_slice ( $mce_buttons $pos +1));
  9.     }
  10.      return   $mce_buttons ;
  11. }

Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!

 weinxin
My Wechat
Copyright Notice
Please indicate the source and link of the original article reprinted on this site. Thank you for your cooperation!
five hundred and ninety-eight million eight hundred and forty-five thousand and six
 
 Robin
five hundred and ninety-eight million eight hundred and forty-five thousand and six
Comments five    Visitors five
    •  Smart Internet
      Smart Internet three

      Try it.

      •  Fragile memory
        Fragile memory one

        The code is garbled after being added!

        •  Zouming
          Zouming one

          Yes, thank you

          •  Chinaverve
            Chinaverve one

            Very practical

            •  Leapfrog net
              Leapfrog net four

              The update disappeared

             anonymous

            Comment

            Anonymous netizens
             :?:  :razz:  :sad:  :evil:  :!:  :smile:  :oops:  :grin:  :eek:  :shock:  :???:  :cool:  :lol:  :mad:  :twisted:  :roll:  :wink:  :idea:  :arrow:  :neutral:  :cry:  :mrgreen:

            Drag the slider to complete validation