Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( !function_exists( 'fb_browser_warning' ) ) {
- function fb_browser_warning() {
- ?>
- <style>
- .fb_browser_warning {
- position: relative;
- background: #3B5998;
- padding: 20px 20px 20px 80px;
- color: #fff;
- }
- .fb_browser_warning:before {
- position: absolute;
- font-family: "etModules";
- content: "\e093";
- margin-left: -50px;
- top: calc(50% - 10px);
- font-size: 24px;
- }
- </style>
- <script>
- var ua = navigator.userAgent || navigator.vendor || window.opera;
- function isFacebookApp() {
- return (ua.indexOf("FB_IAB") > -1) && (ua.indexOf("FBAV") > -1);
- }
- if (isFacebookApp()) {
- jQuery(function($){
- $("<div class='fb_browser_warning'><p>The facebook in-app browser is notoriously buggy. Please switch to a more stable browser.</p></div>").prependTo("#main-content");
- });
- }
- </script>
- <?php
- }
- }
- add_action('wp_head', 'fb_browser_warning', 950 ,1);
- ?>
Add Comment
Please, Sign In to add comment