Advertisements

user_can_richedit

Definition:
function user_can_richedit() {}

Whether the user should have a WYSIWIG editor.
Checks that the user requires a WYSIWIG editor and that the editor is supported in the users browser.

Defined filters

  • user_can_richedit
    apply_filters('user_can_richedit', $wp_rich_edit)

Source code

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) ) {

		$wp_rich_edit = false;



		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;

			} elseif ( $is_gecko || $is_opera || $is_chrome || $is_IE ) {

				$wp_rich_edit = true;

			}

		}

	}



	return apply_filters('user_can_richedit', $wp_rich_edit);

}

3295

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: