/includes/admin/settings/tab-tracking.php

  1. <?php 
  2. /** 
  3. * General Settings Tab. 
  4. * 
  5. * @since 6.0.0 
  6. * 
  7. * @package MonsterInsights 
  8. * @subpackage Settings 
  9. * @author Chris Christoff 
  10. */ 
  11.  
  12. // Exit if accessed directly 
  13. if ( ! defined( 'ABSPATH' ) ) { 
  14. exit; 
  15.  
  16. /** 
  17. * Callback for displaying the UI for general settings tab. 
  18. * 
  19. * @since 6.0.0 
  20. * @access public 
  21. * 
  22. * @return void 
  23. */ 
  24. function monsterinsights_settings_tracking_tab() { 
  25. // Get settings 
  26. ?> 
  27. <div id="monsterinsights-settings-tracking" class="monsterinsights-sub-nav-area"> 
  28. <!-- Tabs --> 
  29. <h1 id="monsterinsights-settings-page-sub-nav" class="monsterinsights-sub-nav-container monsterinsights-nav-container" data-container="#monsterinsights-settings-sub-pages"> 
  30. <?php  
  31. $i = 0; 
  32. $class = ''; 
  33. $is_pro = monsterinsights_is_pro_version(); 
  34. foreach ( (array) monsterinsights_get_settings_tabs() as $id => $item ) { 
  35. if ( isset( $item['comingsoon'] ) && $item['comingsoon'] || empty( $item['title'] ) ) { 
  36. continue; 
  37. $class = ( 0 === $i ? 'monsterinsights-active' : '' );  
  38. $upgrade_span = ! $is_pro && $item['level'] !== 'lite' ? '<span class="monsterinsights-upgrade-menu-icon">' . esc_html__( 'Upgrade', 'google-analytics-for-wordpress' ) . '</span>' : ''; 
  39. ?> 
  40. <a class="monsterinsights-sub-nav-item monsterinsights-nav-item monsterinsights-active monstericon-<?php echo esc_attr( $id ); ?> <?php echo esc_attr( $class ); ?>" href="#monsterinsights-main-tab-tracking?monsterinsights-sub-tab-<?php echo esc_attr( $id ); ?>" title="<?php echo esc_attr( $item['title'] ); ?>"> 
  41. <?php echo esc_html( $item['title'] ) . $upgrade_span; ?> 
  42. </a> 
  43. <?php  
  44. $i++;  
  45. ?> 
  46. </h1> 
  47.  
  48. <h1 class="monsterinsights-hideme"></h1><!-- so wp notices are below the nav bar --> 
  49.  
  50. <?php  
  51. // Output any notices now 
  52. /**  
  53. * Developer Alert: 
  54. * 
  55. * Per the README, this is considered an internal hook and should 
  56. * not be used by other developers. This hook's behavior may be modified 
  57. * or the hook may be removed at any time, without warning. 
  58. */ 
  59. do_action( 'monsterinsights_settings_tracking_tab_notice' ); 
  60. ?> 
  61.  
  62. <!-- Tab Panels --> 
  63. <div id="monsterinsights-settings-sub-pages" class="monsterinsights-sub-nav-tabs monsterinsights-nav-tabs" data-navigation="#monsterinsights-settings-page-sub-nav"> 
  64. <?php  
  65. $i = 0;  
  66. foreach ( (array) monsterinsights_get_settings_tabs() as $id => $item ) { 
  67. if ( isset( $item['comingsoon'] ) && $item['comingsoon'] || empty( $item['title'] ) ) { 
  68. continue; 
  69. $class = ( 0 === $i ? ' monsterinsights-active' : '' );  
  70. ?> 
  71. <div id="monsterinsights-sub-tab-<?php echo esc_attr( $id ); ?>" class="monsterinsights-sub-nav-tab monsterinsights-nav-tab<?php echo esc_attr( $class ); ?>"> 
  72. <?php 
  73. if ( has_action( 'monsterinsights_tab_settings_tracking_' . $id ) ) { 
  74. /**  
  75. * Developer Alert: 
  76. * 
  77. * This internal use action will be removed soon. DO NOT USE. 
  78. */ 
  79. do_action( 'monsterinsights_tab_settings_tracking_' . $id ); 
  80. } else {  
  81. ?> 
  82. <?php echo '<h2 class="monsterinsights-sub-tab-header">' . esc_html( $item['title'] ) . '</h2>'; ?> 
  83. <div class="monsterinsights-subtab-settings-notices"> 
  84. <?php  
  85. // Output any notices now 
  86. /**  
  87. * Developer Alert: 
  88. * 
  89. * Per the README, this is considered an internal hook and should 
  90. * not be used by other developers. This hook's behavior may be modified 
  91. * or the hook may be removed at any time, without warning. 
  92. */ 
  93. do_action( 'monsterinsights_tracking_' . $id . '_tab_notice' ); 
  94. ?> 
  95. </div> 
  96. <!-- Settings Form --> 
  97. <form id="monsterinsights-tracking-<?php echo esc_attr( $id );?>-tab" method="post"> 
  98. <table class="form-table"> 
  99. <tbody> 
  100. <?php 
  101. //do_action( 'monsterinsights_settings_tab_top_' . $id ); 
  102. echo monsterinsights_get_section_settings( $id, 'tracking' ); 
  103. //do_action( 'monsterinsights_settings_tab_bottom_' . $id ); 
  104. ?> 
  105. </tbody> 
  106. </table> 
  107. <?php echo monsterinsights_render_submit_field( $id, 'tracking' ); ?> 
  108. </form> 
  109. <?php } ?> 
  110. </div> 
  111. <?php 
  112. $i++; 
  113. ?> 
  114. </div> 
  115. </div> 
  116. <?php 
  117. add_action( 'monsterinsights_tab_settings_tracking', 'monsterinsights_settings_tracking_tab' ); 
.