/var/www/hkosl.com/aga/wp-content/themes/fitness-park/inc/customizer-pro/class-customize.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class Fitness_Park_Customize {

    
/**
     * Returns the instance.
     *
     * @since  1.0.0
     * @access public
     * @return object
     */
    
public static function get_instance() {

        static 
$instance null;

        if ( 
is_null$instance ) ) {
            
$instance = new self;
            
$instance->setup_actions();
        }

        return 
$instance;
    }

    
/**
     * Constructor method.
     *
     * @since  1.0.0
     * @access private
     * @return void
     */
    
private function __construct() {}

    
/**
     * Sets up initial actions.
     *
     * @since  1.0.0
     * @access private
     * @return void
     */
    
private function setup_actions() {

        
// Register panels, sections, settings, controls, and partials.
        
add_action'customize_register', array( $this'sections' ) );

        
// Register scripts and styles for the controls.
        
add_action'customize_controls_enqueue_scripts', array( $this'enqueue_control_scripts' ), );
    }

    
/**
     * Sets up the customizer sections.
     *
     * @since  1.0.0
     * @access public
     * @param  object  $manager
     * @return void
     */
    
public function sections$manager ) {

        
// Load custom sections.
        
require_once get_theme_file_path('inc/customizer-pro/section-pro.php');

        
// Register custom section types.
        
$manager->register_section_type'Fitness_Park_Customize_Section_Pro' );

        
// Register sections.
        
$manager->add_section(
            new 
Fitness_Park_Customize_Section_Pro(
                
$manager,
                
'fitnesspark',
                array(
                    
'title'    => '',
                    
'pro_text' => esc_html__'Upgrade To Fitness Park Pro','fitness-park' ),
                    
'pro_url'  => 'https://sparklewpthemes.com/wordpress-themes/fitnessparkpro/',
                    
'priority'  => 1,
                )
            )
        );
    }

    
/**
     * Loads theme customizer CSS.
     *
     * @since  1.0.0
     * @access public
     * @return void
     */
    
public function enqueue_control_scripts() {

        
wp_enqueue_script'fitnesspark-customize-controls'trailingslashitget_template_directory_uri() ) . 'inc/customizer-pro/customize-controls.js', array( 'customize-controls' ) );

        
wp_enqueue_style'fitnesspark-customize-controls'trailingslashitget_template_directory_uri() ) . 'inc/customizer-pro/customize-controls.css' );
    }
}

// Doing this customizer thang!
Fitness_Park_Customize::get_instance();