Filter hook 'wp_default_editor'

in WP Core File wp-includes/general-template.php at line 3943

View Source

wp_default_editor

Filter Hook
Description
Filters which editor should be displayed by default.

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 3943

Hook Parameters

Type Name Description
string $r Which editor should be displayed by default. Either 'tinymce', 'html', or 'test'.

Usage Examples

Basic Usage
<?php
// Hook into wp_default_editor
add_filter('wp_default_editor', 'my_custom_filter', 10, 1);

function my_custom_filter($r) {
    // Your custom filtering logic here
    return $r;
}

Source Code Context

wp-includes/general-template.php:3943 - How this hook is used in WordPress core
<?php
3938  	 *
3939  	 * @since 2.5.0
3940  	 *
3941  	 * @param string $r Which editor should be displayed by default. Either 'tinymce', 'html', or 'test'.
3942  	 */
3943  	return apply_filters( 'wp_default_editor', $r );
3944  }
3945  
3946  /**
3947   * Renders an editor.
3948   *

PHP Documentation

<?php
/**
	 * 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'.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.