Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




user_can_richedit [ WordPress Function ]

user_can_richedit ( No parameters )
Returns:
  • (bool)
Defined at:



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);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics