wp_default_editor

Find out which editor should be displayed by default.

Description

(string) wp_default_editor(); 

Works out which of the two editors to display as the current editor for a user. The html setting is for the Text editor tab.

Returns (string)

Either 'tinymce', or 'html', or 'test'


Usage

  1. if ( !function_exists( 'wp_default_editor' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_default_editor(); 
  7.  

Defined (1)

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

/wp-includes/general-template.php  
  1. function wp_default_editor() { 
  2. $r = user_can_richedit() ? 'tinymce' : 'html'; // defaults 
  3. if ( wp_get_current_user() ) { // look for cookie 
  4. $ed = get_user_setting('editor', 'tinymce'); 
  5. $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r; 
  6.  
  7. /** 
  8. * Filters which editor should be displayed by default. 
  9. * @since 2.5.0 
  10. * @param string $r Which editor should be displayed by default. Either 'tinymce', 'html', or 'test'. 
  11. */