register_TSpell_button

Hook into the TinyMCE buttons and replace the current spellchecker.

Description

register_TSpell_button( $buttons ); 

Parameters (1)

0. $buttons
The buttons.

Usage

  1. if ( !function_exists( 'register_TSpell_button' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'tinymce-spellcheck/tinymce-spellcheck.php'; 
  3.  
  4. // The buttons. 
  5. $buttons = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = register_TSpell_button($buttons); 
  9.  

Defined (1)

The function is defined in the following location(s).

/tinymce-spellcheck.php  
  1. function register_TSpell_button( $buttons ) { 
  2. if ( TSPELL_TINYMCE_4 ) { 
  3. // Use the default icon in TinyMCE 4.0 (replaced by dashicons in editor.css) 
  4. if ( ! in_array( 'spellchecker', $buttons, true ) ) { 
  5. $buttons[] = 'spellchecker'; 
  6.  
  7. return $buttons; 
  8.  
  9. /** kill the spellchecker.. don't need no steenkin PHP spell checker */ 
  10. foreach ( $buttons as $key => $button ) { 
  11. if ( $button == 'spellchecker' ) { 
  12. $buttons[$key] = 'AtD'; 
  13. return $buttons; 
  14.  
  15. /** hrm... ok add us last plz */ 
  16. array_push( $buttons, '|', 'AtD' ); 
  17. return $buttons;