get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; //add home page setting pannel $wp_customize->add_panel( 'ca_painting_panel_id', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __( 'Manage Your Setting', 'ca-painting' ), 'description' => __( 'This manages the theme settings', 'ca-painting' ), ) ); $font_array = array( '' => __( 'No Fonts', 'ca-painting' ), 'Abril Fatface' => __( 'Abril Fatface', 'ca-painting' ), 'Acme' => __( 'Acme', 'ca-painting' ), 'Anton' => __( 'Anton', 'ca-painting' ), 'Architects Daughter' => __( 'Architects Daughter', 'ca-painting' ), 'Arimo' => __( 'Arimo', 'ca-painting' ), 'Arsenal' => __( 'Arsenal', 'ca-painting' ), 'Arvo' => __( 'Arvo', 'ca-painting' ), 'Alegreya' => __( 'Alegreya', 'ca-painting' ), 'Alfa Slab One' => __( 'Alfa Slab One', 'ca-painting' ), 'Averia Serif Libre' => __( 'Averia Serif Libre', 'ca-painting' ), 'Bangers' => __( 'Bangers', 'ca-painting' ), 'Boogaloo' => __( 'Boogaloo', 'ca-painting' ), 'Bad Script' => __( 'Bad Script', 'ca-painting' ), 'Bitter' => __( 'Bitter', 'ca-painting' ), 'Bree Serif' => __( 'Bree Serif', 'ca-painting' ), 'BenchNine' => __( 'BenchNine', 'ca-painting' ), 'Cabin' => __( 'Cabin', 'ca-painting' ), 'Cardo' => __( 'Cardo', 'ca-painting' ), 'Courgette' => __( 'Courgette', 'ca-painting' ), 'Cherry Swash' => __( 'Cherry Swash', 'ca-painting' ), 'Cormorant Garamond' => __( 'Cormorant Garamond', 'ca-painting' ), 'Crimson Text' => __( 'Crimson Text', 'ca-painting' ), 'Cuprum' => __( 'Cuprum', 'ca-painting' ), 'Cookie' => __( 'Cookie', 'ca-painting' ), 'Chewy' => __( 'Chewy', 'ca-painting' ), 'Days One' => __( 'Days One', 'ca-painting' ), 'Dosis' => __( 'Dosis', 'ca-painting' ), 'Economica' => __( 'Economica', 'ca-painting' ), 'Fredoka One' => __( 'Fredoka One', 'ca-painting' ), 'Fjalla One' => __( 'Fjalla One', 'ca-painting' ), 'Francois One' => __( 'Francois One', 'ca-painting' ), 'Frank Ruhl Libre' => __( 'Frank Ruhl Libre', 'ca-painting' ), 'Gloria Hallelujah' => __( 'Gloria Hallelujah', 'ca-painting' ), 'Great Vibes' => __( 'Great Vibes', 'ca-painting' ), 'Handlee' => __( 'Handlee', 'ca-painting' ), 'Hammersmith One' => __( 'Hammersmith One', 'ca-painting' ), 'Inconsolata' => __( 'Inconsolata', 'ca-painting' ), 'Indie Flower' => __( 'Indie Flower', 'ca-painting' ), 'IM Fell English SC' => __( 'IM Fell English SC', 'ca-painting' ), 'Julius Sans One' => __( 'Julius Sans One', 'ca-painting' ), 'Josefin Slab' => __( 'Josefin Slab', 'ca-painting' ), 'Josefin Sans' => __( 'Josefin Sans', 'ca-painting' ), 'Kanit' => __( 'Kanit', 'ca-painting' ), 'Lobster' => __( 'Lobster', 'ca-painting' ), 'Lato' => __( 'Lato', 'ca-painting' ), 'Lora' => __( 'Lora', 'ca-painting' ), 'Libre Baskerville' => __( 'Libre Baskerville', 'ca-painting' ), 'Lobster Two' => __( 'Lobster Two', 'ca-painting' ), 'Merriweather' => __( 'Merriweather', 'ca-painting' ), 'Monda' => __( 'Monda', 'ca-painting' ), 'Montserrat' => __( 'Montserrat', 'ca-painting' ), 'Muli' => __( 'Muli', 'ca-painting' ), 'Marck Script' => __( 'Marck Script', 'ca-painting' ), 'Noto Serif' => __( 'Noto Serif', 'ca-painting' ), 'Open Sans' => __( 'Open Sans', 'ca-painting' ), 'Overpass' => __( 'Overpass', 'ca-painting' ), 'Overpass Mono' => __( 'Overpass Mono', 'ca-painting' ), 'Oxygen' => __( 'Oxygen', 'ca-painting' ), 'Orbitron' => __( 'Orbitron', 'ca-painting' ), 'Patua One' => __( 'Patua One', 'ca-painting' ), 'Pacifico' => __( 'Pacifico', 'ca-painting' ), 'Padauk' => __( 'Padauk', 'ca-painting' ), 'Playball' => __( 'Playball', 'ca-painting' ), 'Playfair Display' => __( 'Playfair Display', 'ca-painting' ), 'PT Sans' => __( 'PT Sans', 'ca-painting' ), 'Philosopher' => __( 'Philosopher', 'ca-painting' ), 'Permanent Marker' => __( 'Permanent Marker', 'ca-painting' ), 'Poiret One' => __( 'Poiret One', 'ca-painting' ), 'Quicksand' => __( 'Quicksand', 'ca-painting' ), 'Quattrocento Sans' => __( 'Quattrocento Sans', 'ca-painting' ), 'Raleway' => __( 'Raleway', 'ca-painting' ), 'Rubik' => __( 'Rubik', 'ca-painting' ), 'Rokkitt' => __( 'Rokkitt', 'ca-painting' ), 'Russo One' => __( 'Russo One', 'ca-painting' ), 'Righteous' => __( 'Righteous', 'ca-painting' ), 'Slabo' => __( 'Slabo', 'ca-painting' ), 'Source Sans Pro' => __( 'Source Sans Pro', 'ca-painting' ), 'Shadows Into Light Two' => __( 'Shadows Into Light Two', 'ca-painting'), 'Shadows Into Light' => __( 'Shadows Into Light', 'ca-painting' ), 'Sacramento' => __( 'Sacramento', 'ca-painting' ), 'Shrikhand' => __( 'Shrikhand', 'ca-painting' ), 'Tangerine' => __( 'Tangerine', 'ca-painting' ), 'Ubuntu' => __( 'Ubuntu', 'ca-painting' ), 'VT323' => __( 'VT323', 'ca-painting' ), 'Varela Round' => __( 'Varela Round', 'ca-painting' ), 'Vampiro One' => __( 'Vampiro One', 'ca-painting' ), 'Vollkorn' => __( 'Vollkorn', 'ca-painting' ), 'Volkhov' => __( 'Volkhov', 'ca-painting' ), 'Yanone Kaffeesatz' => __( 'Yanone Kaffeesatz', 'ca-painting' ) ); require get_template_directory() . '/inc/customizer-files/section-home.php'; require get_template_directory() . '/inc/customizer-files/section-footer.php'; } add_action( 'customize_register', 'ca_painting_theme_customize_register' ); //Integer function ca_painting_sanitize_integer( $input ) { if( is_numeric( $input ) ) { return intval( $input ); } } /** * Singleton class for handling the theme's customizer integration. * * @since 1.0.0 * @access public */ final class ca_painting_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' ), 0 ); } /** * Sets up the customizer sections. * * @since 1.0.0 * @access public * @param object $manager * @return void */ public function sections( $manager ) { // Load custom sections. load_template( trailingslashit( get_template_directory() ) . '/inc/gopro-section.php' ); // Register custom section types. $manager->register_section_type( 'ca_painting_customize_buy_now' ); // Register sections. $manager->add_section( new ca_painting_customize_buy_now( $manager, 'example_1', array( 'title' => esc_html__( 'Painting Premium Theme', 'ca-painting' ), 'buy_now_text' => esc_html__( 'Buy Now', 'ca-painting' ), 'buy_now_url' => 'https://chitrarchana.com/?page_id=16', 'priority' => 1 ) ) ); } /** * Loads theme customizer CSS. * * @since 1.0.0 * @access public * @return void */ public function enqueue_control_scripts() { wp_enqueue_script( 'ca-painting-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/js/customize-controls.js', array( 'customize-controls' ) ); wp_enqueue_style( 'ca-painting-customize-controls', trailingslashit( get_template_directory_uri() ) . '/assets/css/customize-controls.css' ); } } // Doing this customizer thang! ca_painting_customize::get_instance();