wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_default_editor › WordPress Function
Since2.5.0
已弃用n/a
› wp_default_editor ( 没有参数 )
返回: |
|
定义在: |
|
文档: |
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.Related Functions: wp_enqueue_editor, wp_default_styles, wp_default_packages_vendor, wp_default_scripts, wp_editor
源码
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 ); }