From b7bbb13ca5346bfc0471109a6a960ff063353d3a Mon Sep 17 00:00:00 2001 From: azaozz Date: Wed, 23 Nov 2011 22:49:17 +0000 Subject: [PATCH] Changes user_can_richedit() to default to true for logged out users, same as the default for logged in users, fixes #19320 git-svn-id: http://svn.automattic.com/wordpress/trunk@19432 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-editor.php | 8 ++------ wp-includes/general-template.php | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 8ed9163ca3..e28cd8c8fd 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -38,15 +38,11 @@ final class _WP_Editors { 'editor_class' => '', // add extra class(es) to the editor textarea 'teeny' => false, // output the minimal editor config used in Press This 'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css) - 'tinymce' => null, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array() + 'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array() 'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array() ) ); - if ( null === $set['tinymce'] ) - self::$this_tinymce = user_can_richedit(); - else - self::$this_tinymce = (bool) $set['tinymce']; - + self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() ); self::$this_quicktags = (bool) $set['quicktags']; if ( self::$this_tinymce ) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 921523e800..890faf4981 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1749,10 +1749,10 @@ function rich_edit_exists() { function user_can_richedit() { global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_iphone, $is_IE; - if ( !isset( $wp_rich_edit) ) { + if ( !isset($wp_rich_edit) ) { $wp_rich_edit = false; - if ( get_user_option( 'rich_editing' ) == 'true' ) { + if ( get_user_option( 'rich_editing' ) == 'true' || !is_user_logged_in() ) { // default to 'true' for logged out users if ( $is_safari ) { if ( !$is_iphone || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 534 ) ) $wp_rich_edit = true;