teeny_mce_before_init

Filters the teenyMCE config before init.

Description

apply_filters( 'teeny_mce_before_init', (array) $mceinit, (string) $editor_id ); 

Parameters (2)

0. $mceinit (array)
An array with teenyMCE config.
1. $editor_id (string)
Unique editor identifier, e.g. content..

Usage

To run the hook, copy the example below.
  1. $mceinit = apply_filters( 'teeny_mce_before_init', $mceinit, $editor_id ); 
  2.  
  3. if ( !empty( $mceinit ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the teeny_mce_before_init callback 
  2. function filter_teeny_mce_before_init( $mceinit, $editor_id ) { 
  3. // make filter magic happen here... 
  4. return $mceinit
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'teeny_mce_before_init', 'filter_teeny_mce_before_init', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'teeny_mce_before_init', 'filter_teeny_mce_before_init', 10, 2 ); 

Defined (2)

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

/wp-includes/class-wp-editor.php  
  1. $mceInit = apply_filters( 'teeny_mce_before_init', $mceInit, $editor_id ); 
/wp-includes/default-filters.php  
  1. add_filter( 'teeny_mce_before_init', '_mce_set_direction' );