Advertisement
Guest User

Untitled

a guest
Jun 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: ifixelectronics-mustuse
  4. Plugin URI: http://ifixelectronics.com.au
  5. Description: Adds a Google analytics tracking code and favicons to the <head> of your theme, by hooking to wp_head, and changes css of menu ect by hooking to wp_footer
  6. Author: Ben Nash
  7. Version: 1.0
  8. */
  9.  
  10. add_action( 'admin_menu', 'custom_admin_menu' );
  11.  
  12. function custom_admin_menu() {
  13.  
  14. add_menu_page( 'RepairShopr', 'RepairShopr', 'manage_options', 'repairshopr.php', 'repairshopr_admin', 'dashicons-admin-tools', 6 );
  15.  
  16. }
  17.  
  18. function repairshopr_admin(){
  19. ?>
  20.  
  21. <iframe src="https://ifixelectronics.repairshopr.com" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:1000px;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px" height="1000" width="100%"></iframe>
  22. <?php
  23. }
  24.  
  25. function google_analytics() { ?>
  26. <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
  27. <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
  28. <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
  29. <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
  30. <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
  31. <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
  32. <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
  33. <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
  34. <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
  35. <link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
  36. <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
  37. <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
  38. <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
  39. <link rel="manifest" href="/manifest.json">
  40. <meta name="msapplication-TileColor" content="#ffffff">
  41. <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
  42. <meta name="theme-color" content="#ffffff">
  43.  
  44. <?php }
  45. add_action( 'wp_head', 'google_analytics', 10 );
  46.  
  47. /**
  48. * Optimize WooCommerce Scripts
  49. * Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
  50. */
  51. add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
  52.  
  53. function child_manage_woocommerce_styles() {
  54. //remove generator meta tag
  55. remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
  56.  
  57. //first check that woo exists to prevent fatal errors
  58. if ( function_exists( 'is_woocommerce' ) ) {
  59. //dequeue scripts and styles
  60. if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
  61. wp_dequeue_style( 'woocommerce_frontend_styles' );
  62. wp_dequeue_style( 'woocommerce_fancybox_styles' );
  63. wp_dequeue_style( 'woocommerce_chosen_styles' );
  64. wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
  65. wp_dequeue_script( 'wc_price_slider' );
  66. wp_dequeue_script( 'wc-single-product' );
  67. wp_dequeue_script( 'wc-add-to-cart' );
  68. wp_dequeue_script( 'wc-cart-fragments' );
  69. wp_dequeue_script( 'wc-checkout' );
  70. wp_dequeue_script( 'wc-add-to-cart-variation' );
  71. wp_dequeue_script( 'wc-single-product' );
  72. wp_dequeue_script( 'wc-cart' );
  73. wp_dequeue_script( 'wc-chosen' );
  74. wp_dequeue_script( 'woocommerce' );
  75. wp_dequeue_script( 'prettyPhoto' );
  76. wp_dequeue_script( 'prettyPhoto-init' );
  77. wp_dequeue_script( 'jquery-blockui' );
  78. wp_dequeue_script( 'jquery-placeholder' );
  79. wp_dequeue_script( 'fancybox' );
  80. wp_dequeue_script( 'jqueryui' );
  81. }
  82. }
  83.  
  84. }
  85.  
  86.  
  87.  
  88. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement