#38327 closed defect (bug) (fixed)
Inline docs indicate wp_default_editor filter accepts an array but it actually filters a string
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.7 | Priority: | normal |
| Severity: | normal | Version: | 3.9 |
| Component: | Editor | Keywords: | |
| Focuses: | docs | Cc: |
Description
Looking at wp_default_editor() inside general-template.php, the wp_default_editor filter takes the string $r (which is either 'tinymce', 'html', or 'test'), but the inline docs suggest that an array is being filtered.
/**
* Find 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.
*
* @since 2.5.0
*
* @return string Either 'tinymce', or 'html', or 'test'
*/
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 array $r An array of editors. Accepts 'tinymce', 'html', 'test'.
*/
return apply_filters( 'wp_default_editor', $r );
}
Change History (5)
Note: See
TracTickets for help on using
tickets.
In 39074: