WordPress.org

Make WordPress Core

Ticket #37321: 37321.2.diff

File 37321.2.diff, 1.9 KB (added by gma992, 4 years ago)

Clarified descriptions, added $is_edge

  • src/wp-includes/general-template.php

     
    28842884}
    28852885
    28862886/**
    2887  * Whether the user should have a WYSIWIG editor.
     2887 * Whether the user can access the WYSIWYG visual editor.
    28882888 *
    2889  * Checks that the user requires a WYSIWIG editor and that the editor is
    2890  * supported in the users browser.
     2889 * Checks if the user can access the WYSIWYG visual editor and detects the user's browser.
    28912890 *
    28922891 * @since 2.0.0
    28932892 *
    2894  * @global bool $wp_rich_edit
    2895  * @global bool $is_gecko
    2896  * @global bool $is_opera
    2897  * @global bool $is_safari
    2898  * @global bool $is_chrome
    2899  * @global bool $is_IE
     2893 * @global bool $wp_rich_edit   Checks if the user can access the WYSIWYG visual editor.
     2894 * @global bool $is_gecko               Detects if browser is a Gecko-based browser
     2895 * @global bool $is_opera               Detects if browser is Opera
     2896 * @global bool $is_safari              Detects if browser is Safari (AppleWebkit engine instead of Gecko-based)
     2897 * @global bool $is_chrome              Detects if browser is Chrome
     2898 * @global bool $is_IE          Detects if browser is Internet Explorer
     2899 * @global bool $is_edge                Detects if browser is Microsoft Edge
    29002900 *
    2901  * @return bool
     2901 * @return bool true if user can access the WYSIWYG visual editor, false otherwise.
    29022902 */
    29032903function user_can_richedit() {
    29042904        global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE, $is_edge;
     
    29162916        }
    29172917
    29182918        /**
    2919          * Filters whether the user can access the rich (Visual) editor.
     2919         * Filters whether the user can access the WYSIWYG visual editor.
    29202920         *
    29212921         * @since 2.1.0
    29222922         *
    2923          * @param bool $wp_rich_edit Whether the user can access to the rich (Visual) editor.
     2923         * @param bool $wp_rich_edit Whether the user can access the WYSIWYG visual editor.
    29242924         */
    29252925        return apply_filters( 'user_can_richedit', $wp_rich_edit );
    29262926}