wp_default_editor() – Find out which editor should be displayed by default.

You appear to be a bot. Output may be restricted

Description

Finds out which editor should be displayed by default.

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.

Usage

$string = wp_default_editor();

Parameters

Returns

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

Source

File name: wordpress/wp-includes/general-template.php
Lines:

1 to 16 of 16
function wp_default_editor() {
  $r = user_can_richedit() ? 'tinymce' : 'html'; // Defaults.
  if ( wp_get_current_user() ) { // Look for cookie.
    $ed = get_user_setting( 'editor', 'tinymce' );
    $r  = ( in_array( $ed, array( 'tinymce', 'html', 'test' ), true ) ) ? $ed : $r;
  }

  
/**
 * Filters which editor should be displayed by default.
 *
 * @since 2.5.0
 *
 * @param string $r Which editor should be displayed by default. Either 'tinymce', 'html', or 'test'.
 */
  return apply_filters( 'wp_default_editor', $r );
}
 

 View on GitHub View on Trac