WC_Predictive_Search_Performance_Settings_Tab

The WooCommerce Predictive Search LITE WC Predictive Search Performance Settings Tab class.

Defined (1)

The class is defined in the following location(s).

/admin/tabs/performance-settings-tab.php  
  1. class WC_Predictive_Search_Performance_Settings_Tab extends WC_Predictive_Search_Admin_UI 
  2. {  
  3. /** 
  4. * @var string 
  5. */ 
  6. private $parent_page = 'woo-predictive-search'; 
  7.  
  8. /** 
  9. * @var string 
  10. * You can change the order show of this tab in list tabs 
  11. */ 
  12. private $position = 2; 
  13.  
  14. /** 
  15. * @var array 
  16. */ 
  17. private $tab_data; 
  18.  
  19. /**-----------------------------------------------------------------------------------*/ 
  20. /** __construct() */ 
  21. /** Settings Constructor */ 
  22. /**-----------------------------------------------------------------------------------*/ 
  23. public function __construct() { 
  24.  
  25. $this->settings_include(); 
  26. $this->tab_init(); 
  27.  
  28. /**-----------------------------------------------------------------------------------*/ 
  29. /** tab_init() */ 
  30. /** Tab Init */ 
  31. /**-----------------------------------------------------------------------------------*/ 
  32. public function tab_init() { 
  33.  
  34. add_filter( $this->plugin_name . '-' . $this->parent_page . '_settings_tabs_array', array( $this, 'add_tab' ), $this->position ); 
  35.  
  36.  
  37. /** 
  38. * tab_data() 
  39. * Get Tab Data 
  40. * ============================================= 
  41. * array (  
  42. * 'name' => 'my_tab_name' : (required) Enter your tab name that you want to set for this tab 
  43. * 'label' => 'My Tab Name' : (required) Enter the tab label 
  44. * 'callback_function' => 'my_callback_function' : (required) The callback function is called to show content of this tab 
  45. * ) 
  46. */ 
  47. public function tab_data() { 
  48.  
  49. $tab_data = array(  
  50. 'name' => 'performance-settings',  
  51. 'label' => __( 'Performance', 'woops' ),  
  52. 'callback_function' => 'wc_predictive_search_performance_settings_tab_manager',  
  53. ); 
  54.  
  55. if ( $this->tab_data ) return $this->tab_data; 
  56. return $this->tab_data = $tab_data; 
  57.  
  58.  
  59. /**-----------------------------------------------------------------------------------*/ 
  60. /** add_tab() */ 
  61. /** Add tab to Admin Init and Parent Page 
  62. /**-----------------------------------------------------------------------------------*/ 
  63. public function add_tab( $tabs_array ) { 
  64.  
  65. if ( ! is_array( $tabs_array ) ) $tabs_array = array(); 
  66. $tabs_array[] = $this->tab_data(); 
  67.  
  68. return $tabs_array; 
  69.  
  70. /**-----------------------------------------------------------------------------------*/ 
  71. /** panels_include() */ 
  72. /** Include form settings panels  
  73. /**-----------------------------------------------------------------------------------*/ 
  74. public function settings_include() { 
  75.  
  76. // Includes Settings file 
  77. include_once( $this->admin_plugin_dir() . '/settings/performance-settings.php' ); 
  78.  
  79.  
  80. /**-----------------------------------------------------------------------------------*/ 
  81. /** tab_manager() */ 
  82. /** Call tab layout from Admin Init  
  83. /**-----------------------------------------------------------------------------------*/ 
  84. public function tab_manager() { 
  85. global $wc_predictive_search_performance_settings; 
  86.  
  87. $this->plugin_extension_start(); 
  88. $wc_predictive_search_performance_settings->settings_form(); 
  89. $this->plugin_extension_end(); 
  90.