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
if ( !function_exists( 'register_TSpell_button' ) ) { require_once ABSPATH . PLUGINDIR . 'tinymce-spellcheck/tinymce-spellcheck.php'; } // The buttons. $buttons = null; // NOTICE! Understand what this does before running. $result = register_TSpell_button($buttons);
Defined (1)
The function is defined in the following location(s).
- /tinymce-spellcheck.php
- function register_TSpell_button( $buttons ) {
- if ( TSPELL_TINYMCE_4 ) {
- // Use the default icon in TinyMCE 4.0 (replaced by dashicons in editor.css)
- if ( ! in_array( 'spellchecker', $buttons, true ) ) {
- $buttons[] = 'spellchecker';
- }
- return $buttons;
- }
- /** kill the spellchecker.. don't need no steenkin PHP spell checker */
- foreach ( $buttons as $key => $button ) {
- if ( $button == 'spellchecker' ) {
- $buttons[$key] = 'AtD';
- return $buttons;
- }
- }
- /** hrm... ok add us last plz */
- array_push( $buttons, '|', 'AtD' );
- return $buttons;
- }