wp_check_browser_version()
Check if the user needs a browser update
No Hooks.
Return
Array|false
. Array of browser data on success, false on failure.
Usage
wp_check_browser_version();
Examples
#1 Using in the admin panel
// Get information about the browser in the admin panel, where it is available. add_action( 'admin_head', function (){ if ( ! function_exists( 'wp_check_browser_version' ) ) { include_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); } $array = wp_check_browser_version(); var_dump( $array ); });
#2 Use it on front-side of the site
// Get information about the browser in the external part of the site // if the function is not available first include the file containing it add_action( 'wp', function () { if ( ! function_exists( 'wp_check_browser_version' ) ) { require_once ABSPATH . 'wp-admin/includes/dashboard.php'; } $array = wp_check_browser_version(); var_dump( $array ); } );
Changelog
Since 3.2.0 | Introduced. |