user_can_richedit [ WordPress Function ]
user_can_richedit ( No parameters )
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: user_can_edit_post, user_can_edit_user, user_can_create_post, user_can_edit_post_date, user_can
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.
Source
<?php
function user_can_richedit() {
global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $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 ( wp_is_mobile() || false !== strpos( $_SERVER['HTTP_USER_AGENT'], '; Silk/' ) )
$wp_rich_edit = ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );
else
$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);
}
?>