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
if ( !function_exists( 'wp_default_editor' ) ) { require_once ABSPATH . WPINC . '/general-template.php'; } // NOTICE! Understand what this does before running. $result = wp_default_editor();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/general-template.php
- 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') ) ) ? $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 );
- }