Guest User

Untitled

a guest
Dec 13th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <?php
  2. if ( !function_exists( 'fb_browser_warning' ) ) {
  3. function fb_browser_warning() {
  4. ?>
  5.  
  6. <style>
  7. .fb_browser_warning {
  8. position: relative;
  9. background: #3B5998;
  10. padding: 20px 20px 20px 80px;
  11. color: #fff;
  12. }
  13.  
  14. .fb_browser_warning:before {
  15. position: absolute;
  16. font-family: "etModules";
  17. content: "\e093";
  18. margin-left: -50px;
  19. top: calc(50% - 10px);
  20. font-size: 24px;
  21. }
  22. </style>
  23.  
  24. <script>
  25. var ua = navigator.userAgent || navigator.vendor || window.opera;
  26.  
  27. function isFacebookApp() {
  28. return (ua.indexOf("FB_IAB") > -1) && (ua.indexOf("FBAV") > -1);
  29. }
  30.  
  31. if (isFacebookApp()) {
  32. jQuery(function($){
  33. $("<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");
  34. });
  35. }
  36.  
  37. </script>
  38. <?php
  39. }
  40. }
  41.  
  42. add_action('wp_head', 'fb_browser_warning', 950 ,1);
  43. ?>
Add Comment
Please, Sign In to add comment