Saving/restoring the user interface state, see #7654

git-svn-id: https://develop.svn.wordpress.org/trunk@8784 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2008-08-31 06:34:43 +00:00
parent 8d72a6d8b7
commit 9ed6500c5b
10 changed files with 324 additions and 59 deletions

View File

@@ -942,8 +942,8 @@ function user_can_richedit() {
function wp_default_editor() {
$r = user_can_richedit() ? 'tinymce' : 'html'; // defaults
if ( $user = wp_get_current_user() ) { // look for cookie
if ( isset($_COOKIE['wordpress_editor_' . $user->ID]) && in_array($_COOKIE['wordpress_editor_' . $user->ID], array('tinymce', 'html', 'test') ) )
$r = $_COOKIE['wordpress_editor_' . $user->ID];
$ed = get_user_setting('editor', 'tinymce');
$r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r;
}
return apply_filters( 'wp_default_editor', $r ); // filter
}