catchresponsive_upgrade_pro_customize

Singleton class for handling the theme's customizer integration.

Defined (1)

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

/inc/customizer-includes/upgrade-button/class-customize.php  
  1. final class catchresponsive_upgrade_pro_customize { 
  2.  
  3. /** 
  4. * Returns the instance. 
  5. * @since 1.0.0 
  6. * @access public 
  7. * @return object 
  8. */ 
  9. public static function get_instance() { 
  10.  
  11. static $instance = null; 
  12.  
  13. if ( is_null( $instance ) ) { 
  14. $instance = new self; 
  15. $instance->setup_actions(); 
  16.  
  17. return $instance; 
  18.  
  19. /** 
  20. * Constructor method. 
  21. * @since 1.0.0 
  22. * @access private 
  23. * @return void 
  24. */ 
  25. private function __construct() {} 
  26.  
  27. /** 
  28. * Sets up initial actions. 
  29. * @since 1.0.0 
  30. * @access private 
  31. * @return void 
  32. */ 
  33. private function setup_actions() { 
  34.  
  35. // Register panels, sections, settings, controls, and partials. 
  36. add_action( 'customize_register', array( $this, 'sections' ) ); 
  37.  
  38. // Register scripts and styles for the controls. 
  39. add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 ); 
  40.  
  41. /** 
  42. * Sets up the customizer sections. 
  43. * @since 1.0.0 
  44. * @access public 
  45. * @param object $manager 
  46. * @return void 
  47. */ 
  48. public function sections( $manager ) { 
  49.  
  50. // Load custom sections. 
  51. require trailingslashit( get_template_directory() ) . 'inc/customizer-includes/upgrade-button/section-pro.php'; 
  52.  
  53. // Register custom section types. 
  54. $manager->register_section_type( 'catchresponsive_upgrade_pro_customize_section_pro' ); 
  55.  
  56. // Register sections. 
  57. $manager->add_section( 
  58. new catchresponsive_upgrade_pro_customize_section_pro( 
  59. $manager,  
  60. 'upgrade_button',  
  61. array( 
  62. 'title' => esc_html__( 'Catch Responsive Pro', 'catch-responsive' ),  
  63. 'pro_text' => esc_html__( 'Upgrade Now', 'catch-responsive' ),  
  64. 'pro_url' => 'https://catchthemes.com/themes/catch-responsive-pro',  
  65. 'priority' => 1 
  66. ); 
  67.  
  68. /** 
  69. * Loads theme customizer CSS. 
  70. * @since 1.0.0 
  71. * @access public 
  72. * @return void 
  73. */ 
  74. public function enqueue_control_scripts() { 
  75.  
  76. wp_enqueue_script( 'catchresponsive-upgrade-button-customize-controls', trailingslashit( get_template_directory_uri() ) . 'inc/customizer-includes/upgrade-button/customize-controls.js', array( 'customize-controls' ) ); 
  77.  
  78. wp_enqueue_style( 'catchresponsive-upgrade-button-customize-controls', trailingslashit( get_template_directory_uri() ) . 'inc/customizer-includes/upgrade-button/customize-controls.css' );