/** * @package VW Car Rental * Setup the WordPress core custom header feature. * * @uses vw_car_rental_header_style() */ function vw_car_rental_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'vw_car_rental_custom_header_args', array( 'default-text-color' => 'fff', 'header-text' => false, 'width' => 1600, 'height' => 92, 'flex-width' => true, 'flex-height' => true, 'wp-head-callback' => 'vw_car_rental_header_style', ) ) ); } add_action( 'after_setup_theme', 'vw_car_rental_custom_header_setup' ); if ( ! function_exists( 'vw_car_rental_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @see vw_car_rental_custom_header_setup(). */ add_action( 'wp_enqueue_scripts', 'vw_car_rental_header_style' ); function vw_car_rental_header_style() { //Check if user has defined any header image. if ( get_header_image() ) : $custom_css = " .main-header{ background-image:url('".esc_url(get_header_image())."'); background-position: center top; background-size: cover; }"; wp_add_inline_style( 'vw-car-rental-basic-style', $custom_css ); endif; } endif; // vw_car_rental_header_style.CodeMirror-fullscreen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: auto; z-index: 9; } if ( ! class_exists( 'VW_Car_Rental_Plugin_Activation_Settings' ) ) { /** * VW_Car_Rental_Plugin_Activation_Settings initial setup * * @since 1.6.2 */ class VW_Car_Rental_Plugin_Activation_Settings { private static $instance; public $action_count; public $recommended_actions; /** Initiator **/ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /* Constructor */ public function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_ibtana' ) ); // ---------- Ibtana Plugin Activation ------- add_filter( 'vw_car_rental_recommended_ibtana_plugins', array($this, 'vw_car_rental_recommended_plugins_array') ); $actions = $this->vw_car_rental_get_recommended_actions(); $this->action_count = $actions['count']; $this->recommended_actions = $actions['actions']; add_action( 'wp_ajax_create_pattern_setup_builder', array( $this, 'create_pattern_setup_builder' ) ); } public function vw_car_rental_recommended_plugins_array($plugins){ $plugins[] = array( 'name' => esc_html__('Ibtana - WordPress Website Builder', 'vw-car-rental'), 'slug' => 'ibtana-visual-editor', 'function' => 'Ibtana_Visual_Editor_Menu_Class', 'desc' => esc_html__('It is recommended that you install the Ibtana - WordPress Website Builder plugin to show advance blocks and templates on pages', 'vw-car-rental'), ); return $plugins; } public function enqueue_scripts_ibtana() { wp_enqueue_script('updates'); wp_register_script( 'vw-car-rental-plugin-activation-script', esc_url(get_template_directory_uri()) . '/assets/js/plugin-activation.js', array('jquery') ); wp_localize_script('vw-car-rental-plugin-activation-script', 'vw_car_rental_plugin_activate_plugin', array( 'installing' => esc_html__('Installing', 'vw-car-rental'), 'activating' => esc_html__('Activating', 'vw-car-rental'), 'error' => esc_html__('Error', 'vw-car-rental'), 'ajax_url' => esc_url(admin_url('admin-ajax.php')), 'ibtana_admin_url' => esc_url(admin_url('admin.php?page=ibtana-visual-editor-templates')), 'addon_admin_url' => esc_url(admin_url('tools.php?page=ibtanaecommerceproductaddons-setup')) ) ); wp_enqueue_script( 'vw-car-rental-plugin-activation-script' ); } // --------- Plugin Actions --------- public function vw_car_rental_get_recommended_actions() { $act_count = 0; $actions_todo = get_option( 'recommending_actions', array()); $plugins = $this->vw_car_rental_get_recommended_plugins(); if ($plugins) { foreach ($plugins as $key => $plugin) { $action = array(); if (!isset($plugin['slug'])) { continue; } $action['id'] = 'install_' . $plugin['slug']; $action['desc'] = ''; if (isset($plugin['desc'])) { $action['desc'] = $plugin['desc']; } $action['name'] = ''; if (isset($plugin['name'])) { $action['title'] = $plugin['name']; } $link_and_is_done = $this->vw_car_rental_get_plugin_buttion($plugin['slug'], $plugin['name'], $plugin['function']); $action['link'] = $link_and_is_done['button']; $action['is_done'] = $link_and_is_done['done']; if (!$action['is_done'] && (!isset($actions_todo[$action['id']]) || !$actions_todo[$action['id']])) { $act_count++; } $recommended_actions[] = $action; $actions_todo[] = array('id' => $action['id'], 'watch' => true); } return array('count' => $act_count, 'actions' => $recommended_actions); } } public function vw_car_rental_get_recommended_plugins() { $plugins = apply_filters('vw_car_rental_recommended_ibtana_plugins', array()); return $plugins; } public function vw_car_rental_get_plugin_buttion($slug, $name, $function) { $is_done = false; $button_html = ''; $is_installed = $this->is_plugin_installed($slug); $plugin_path = $this->get_plugin_basename_from_slug($slug); $is_activeted = (class_exists($function)) ? true : false; if (!$is_installed) { $plugin_install_url = add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $slug, ), self_admin_url('update.php') ); $plugin_install_url = wp_nonce_url($plugin_install_url, 'install-plugin_' . esc_attr($slug)); $button_html = sprintf('%5$s', esc_attr($slug), esc_url($plugin_install_url), sprintf(esc_html__('Install %s Now', 'vw-car-rental'), esc_html($name)), esc_html($name), esc_html__('Install & Activate', 'vw-car-rental') ); } elseif ($is_installed && !$is_activeted) { $plugin_activate_link = add_query_arg( array( 'action' => 'activate', 'plugin' => rawurlencode($plugin_path), 'plugin_status' => 'all', 'paged' => '1', '_wpnonce' => wp_create_nonce('activate-plugin_' . $plugin_path), ), self_admin_url('plugins.php') ); $button_html = sprintf('%5$s', esc_attr($slug), esc_url($plugin_activate_link), sprintf(esc_html__('Activate %s Now', 'vw-car-rental'), esc_html($name)), esc_html($name), esc_html__('Activate', 'vw-car-rental') ); } elseif ($is_activeted) { $button_html = sprintf('
', esc_html__('Active', 'vw-car-rental')); $is_done = true; } return array('done' => $is_done, 'button' => $button_html); } public function is_plugin_installed($slug) { $installed_plugins = $this->get_installed_plugins(); // Retrieve a list of all installed plugins (WP cached). $file_path = $this->get_plugin_basename_from_slug($slug); return (!empty($installed_plugins[$file_path])); } public function get_plugin_basename_from_slug($slug) { $keys = array_keys($this->get_installed_plugins()); foreach ($keys as $key) { if (preg_match('|^' . $slug . '/|', $key)) { return $key; } } return $slug; } public function get_installed_plugins() { if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } return get_plugins(); } public function create_pattern_setup_builder() { $edit_page = admin_url().'post-new.php?post_type=page&create_pattern=true'; echo json_encode(['page_id'=>'','edit_page_url'=> $edit_page ]); exit; } } } /** * Kicking this off by calling 'get_instance()' method */ VW_Car_Rental_Plugin_Activation_Settings::get_instance(); if ( ! class_exists( 'VW_Car_Rental_Plugin_Activation_Woo_Products' ) ) { /** * VW_Car_Rental_Plugin_Activation_Woo_Products initial setup * * @since 1.6.2 */ class VW_Car_Rental_Plugin_Activation_Woo_Products { private static $instance; public $action_count; public $recommended_actions; /** Initiator **/ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /* Constructor */ public function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // ---------- Ibtana Plugin Activation ------- add_filter( 'vw_car_rental_recommended_plugins', array($this, 'vw_car_rental_recommended_woo_products_plugins_array') ); $actions = $this->vw_car_rental_get_recommended_actions(); $this->action_count = $actions['count']; $this->recommended_actions = $actions['actions']; add_action( 'wp_ajax_create_pattern_setup_builder', array( $this, 'create_pattern_setup_builder' ) ); } public function vw_car_rental_recommended_woo_products_plugins_array($plugins){ $plugins[] = array( 'name' => esc_html__('Ibtana - Ecommerce Product Addons', 'vw-car-rental'), 'slug' => 'ibtana-ecommerce-product-addons', 'function' => 'Ibtana_Woo_Addon_Menu_Class', 'desc' => esc_html__('It is recommended that you install the Ibtana - Ecommerce Product Addons plugin to show advance Products blocks and templates on pages', 'vw-car-rental'), ); return $plugins; } public function enqueue_scripts() { wp_enqueue_script('updates'); wp_register_script( 'vw-car-rental-plugin-activation-script', esc_url(get_template_directory_uri()) . '/assets/js/plugin-activation.js', array('jquery') ); wp_localize_script('vw-car-rental-plugin-activation-script', 'vw_car_rental_plugin_activate_plugin', array( 'installing' => esc_html__('Installing', 'vw-car-rental'), 'activating' => esc_html__('Activating', 'vw-car-rental'), 'error' => esc_html__('Error', 'vw-car-rental'), 'ajax_url' => esc_url(admin_url('admin-ajax.php')), 'ibtana_admin_url' => esc_url(admin_url('admin.php?page=ibtana-visual-editor-templates')), 'addon_admin_url' => esc_url(admin_url('tools.php?page=ibtanaecommerceproductaddons-setup')) ) ); wp_enqueue_script( 'vw-car-rental-plugin-activation-script' ); } // --------- Plugin Actions --------- public function vw_car_rental_get_recommended_actions() { $act_count = 0; $actions_todo = get_option( 'recommending_actions', array()); $plugins = $this->vw_car_rental_get_recommended_plugins(); if ($plugins) { foreach ($plugins as $key => $plugin) { $action = array(); if (!isset($plugin['slug'])) { continue; } $action['id'] = 'install_' . $plugin['slug']; $action['desc'] = ''; if (isset($plugin['desc'])) { $action['desc'] = $plugin['desc']; } $action['name'] = ''; if (isset($plugin['name'])) { $action['title'] = $plugin['name']; } $link_and_is_done = $this->vw_car_rental_get_plugin_buttion($plugin['slug'], $plugin['name'], $plugin['function']); $action['link'] = $link_and_is_done['button']; $action['is_done'] = $link_and_is_done['done']; if (!$action['is_done'] && (!isset($actions_todo[$action['id']]) || !$actions_todo[$action['id']])) { $act_count++; } $recommended_actions[] = $action; $actions_todo[] = array('id' => $action['id'], 'watch' => true); } return array('count' => $act_count, 'actions' => $recommended_actions); } } public function vw_car_rental_get_recommended_plugins() { $plugins = apply_filters('vw_car_rental_recommended_plugins', array()); return $plugins; } public function vw_car_rental_get_plugin_buttion($slug, $name, $function) { $is_done = false; $button_html = ''; $is_installed = $this->is_plugin_installed($slug); $plugin_path = $this->get_plugin_basename_from_slug($slug); $is_activeted = (class_exists($function)) ? true : false; if (!$is_installed) { $plugin_install_url = add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $slug, ), self_admin_url('update.php') ); $plugin_install_url = wp_nonce_url($plugin_install_url, 'install-plugin_' . esc_attr($slug)); $button_html = sprintf('%5$s', esc_attr($slug), esc_url($plugin_install_url), sprintf(esc_html__('Install %s Now', 'vw-car-rental'), esc_html($name)), esc_html($name), esc_html__('Install & Activate', 'vw-car-rental') ); } elseif ($is_installed && !$is_activeted) { $plugin_activate_link = add_query_arg( array( 'action' => 'activate', 'plugin' => rawurlencode($plugin_path), 'plugin_status' => 'all', 'paged' => '1', '_wpnonce' => wp_create_nonce('activate-plugin_' . $plugin_path), ), self_admin_url('plugins.php') ); $button_html = sprintf('%5$s', esc_attr($slug), esc_url($plugin_activate_link), sprintf(esc_html__('Activate %s Now', 'vw-car-rental'), esc_html($name)), esc_html($name), esc_html__('Activate', 'vw-car-rental') ); } elseif ($is_activeted) { $button_html = sprintf('', esc_html__('Active', 'vw-car-rental')); $is_done = true; } return array('done' => $is_done, 'button' => $button_html); } public function is_plugin_installed($slug) { $installed_plugins = $this->get_installed_plugins(); // Retrieve a list of all installed plugins (WP cached). $file_path = $this->get_plugin_basename_from_slug($slug); return (!empty($installed_plugins[$file_path])); } public function get_plugin_basename_from_slug($slug) { $keys = array_keys($this->get_installed_plugins()); foreach ($keys as $key) { if (preg_match('|^' . $slug . '/|', $key)) { return $key; } } return $slug; } public function get_installed_plugins() { if (!function_exists('get_plugins')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } return get_plugins(); } public function create_pattern_setup_builder() { $edit_page = admin_url().'post-new.php?post_type=page&create_pattern=true'; echo json_encode(['page_id'=>'','edit_page_url'=> $edit_page ]); exit; } } } /** * Kicking this off by calling 'get_instance()' method */ VW_Car_Rental_Plugin_Activation_Woo_Products::get_instance(); /** * @package VW Car Rental * @subpackage vw-car-rental * */ # Register our customizer panels, sections, settings, and controls. add_action( 'customize_register', 'vw_car_rental_typography_customize_register', 15 ); # Load scripts and styles. add_action( 'customize_controls_enqueue_scripts', 'vw_car_rental_customize_controls_register_scripts' ); add_action( 'customize_preview_init', 'vw_car_rental_customize_preview_enqueue_scripts' ); # Add custom styles to ``. add_action( 'wp_head', 'vw_car_rental_print_styles' ); function vw_car_rental_typography_customize_register( $wp_customize ) { // Load customizer typography control class. load_template( get_template_directory(). '/inc/typography/customize/control-typography.php' ); // Register typography control JS template. $wp_customize->register_control_type( 'VW_Car_Rental_Control_Typography' ); // Add the typography panel. $wp_customize->add_panel( 'vw_car_rental_typography', array( 'priority' => 5, 'title' => esc_html__( 'Typography', 'vw-car-rental' ) ) ); // Add the `` typography section. $wp_customize->add_section( 'vw_car_rental_p_typography', array( 'panel' => 'vw_car_rental_typography', 'title' => esc_html__( 'Content Typography', 'vw-car-rental' ) ) ); // Add the headings typography section. $wp_customize->add_section( 'vw_car_rental_headings_typography', array( 'panel' => 'vw_car_rental_typography', 'title' => esc_html__( 'Headings Typography', 'vw-car-rental' ) ) ); // Add the Global Color typography section. $wp_customize->add_section( 'vw_car_rental_global_typography', array( 'panel' => 'vw_car_rental_typography', 'title' => esc_html__( 'Global Color', 'vw-car-rental' ) ) ); $wp_customize->add_setting( 'vw_car_rental_first_color', array( 'default' => '#bfe428', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_first_color', array( 'label' => __('First Highlight Color', 'vw-car-rental'), 'description' => __('It will change the highlight color in one click.', 'vw-car-rental'), 'section' => 'vw_car_rental_global_typography', 'settings' => 'vw_car_rental_first_color', ))); $wp_customize->add_setting( 'vw_car_rental_second_color', array( 'default' => '#15d0ac', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_second_color', array( 'label' => __('Second Highlight Color', 'vw-car-rental'), 'description' => __('It will change the highlight color in one click.', 'vw-car-rental'), 'section' => 'vw_car_rental_global_typography', 'settings' => 'vw_car_rental_second_color', ))); // Add the `
` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_p_font_color', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_p_font_family', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_p_font_weight', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_p_font_style', array( 'default' => '','sanitize_callback' => 'sanitize_key','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_p_font_size', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_p_line_height', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_p_letter_spacing', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
// Add the `` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_a_font_color', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_a_font_family', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_a_font_weight', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_a_font_style', array( 'default' => '','sanitize_callback' => 'sanitize_key','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_a_font_size', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_a_line_height', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_a_letter_spacing', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
// Add the ` ` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_p_font_color', array(
'label' => esc_html__( 'Paragraph Color', 'vw-car-rental' ),
'description' => __( 'Select how you want your paragraphs to appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_p_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_p_typography', array(
'label' => esc_html__( 'Paragraph Typography', 'vw-car-rental' ),
'description' => __( 'Select how you want your paragraphs to appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_p_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_p_font_family',
'weight' => 'vw_car_rental_p_font_weight',
'style' => 'vw_car_rental_p_font_style',
'size' => 'vw_car_rental_p_font_size',
'line_height' => 'vw_car_rental_p_line_height',
'letter_spacing' => 'vw_car_rental_p_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
// Add the `` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_a_font_color', array(
'label' => esc_html__( 'Anchor Tag Color', 'vw-car-rental' ),
'description' => __( 'Select how you want your a tag to appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_p_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_a_typography', array(
'label' => esc_html__( 'Anchor Tag Typography', 'vw-car-rental' ),
'description' => __( 'Select how you want your a tag to appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_p_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_a_font_family',
'weight' => 'vw_car_rental_a_font_weight',
'style' => 'vw_car_rental_a_font_style',
'size' => 'vw_car_rental_a_font_size',
'line_height' => 'vw_car_rental_a_line_height',
'letter_spacing' => 'vw_car_rental_a_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
// Add the `` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_h1_font_color', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h1_font_family', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h1_font_weight', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h1_font_style', array( 'default' => '','sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h1_font_size', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h1_line_height', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h1_letter_spacing', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
// Add the `
` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_h2_font_color', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h2_font_family', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h2_font_weight', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h2_font_style', array( 'default' => '','sanitize_callback' => 'sanitize_key','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h2_font_size', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h2_line_height', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h2_letter_spacing', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
// Add the `
` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_h3_font_color', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h3_font_family', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h3_font_weight', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h3_font_style', array( 'default' => '','sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h3_font_size', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h3_line_height', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h3_letter_spacing', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
// Add the `
` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_h4_font_color', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h4_font_family', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h4_font_weight', array( 'default' => '','sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h4_font_style', array( 'default' => '','sanitize_callback' => 'sanitize_key', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h4_font_size', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h4_line_height', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h4_letter_spacing', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
// Add the `
` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_h5_font_color', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h5_font_family', array( 'default' => '','sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h5_font_weight', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h5_font_style', array( 'default' => '','sanitize_callback' => 'sanitize_key','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h5_font_size', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h5_line_height', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h5_letter_spacing', array( 'default' => '','sanitize_callback' => 'absint','transport' => 'postMessage' ) );
// Add the `
` typography settings.
// @todo Better sanitize_callback functions.
$wp_customize->add_setting( 'vw_car_rental_h6_font_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h6_font_family', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h6_font_weight', array( 'default' => '', 'sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h6_font_style', array( 'default' => '', 'sanitize_callback' => 'sanitize_key','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h6_font_size', array( 'default' => '', 'sanitize_callback' => 'absint','transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h6_line_height', array( 'default' => '', 'sanitize_callback' => 'absint', 'transport' => 'postMessage' ) );
$wp_customize->add_setting( 'vw_car_rental_h6_letter_spacing', array( 'default' => '', 'sanitize_callback' => 'absint','transport' => 'postMessage' ) );
// Add the `
` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_h1_font_color', array(
'label' => esc_html__( 'Heading 1 Color', 'vw-car-rental' ),
'description' => __( 'Select how heading 1 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_h1_typography', array(
'label' => esc_html__( 'Heading 1', 'vw-car-rental' ),
'description' => __( 'Select how heading 1 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_h1_font_family',
'weight' => 'vw_car_rental_h1_font_weight',
'style' => 'vw_car_rental_h1_font_style',
'size' => 'vw_car_rental_h1_font_size',
'line_height' => 'vw_car_rental_h1_line_height',
'letter_spacing' => 'vw_car_rental_h1_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
// Add the `
` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_h2_font_color', array(
'label' => esc_html__( 'Heading 2 Color', 'vw-car-rental' ),
'description' => __( 'Select how heading 2 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_h2_typography', array(
'label' => esc_html__( 'Heading 2', 'vw-car-rental' ),
'description' => __( 'Select how heading 2 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_h2_font_family',
'weight' => 'vw_car_rental_h2_font_weight',
'style' => 'vw_car_rental_h2_font_style',
'size' => 'vw_car_rental_h2_font_size',
'line_height' => 'vw_car_rental_h2_line_height',
'letter_spacing' => 'vw_car_rental_h2_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
// Add the `
` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_h3_font_color', array(
'label' => esc_html__( 'Heading 3 Color', 'vw-car-rental' ),
'description' => __( 'Select how heading 3 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_h3_typography', array(
'label' => esc_html__( 'Heading 3', 'vw-car-rental' ),
'description' => __( 'Select how heading 3 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_h3_font_family',
'weight' => 'vw_car_rental_h3_font_weight',
'style' => 'vw_car_rental_h3_font_style',
'size' => 'vw_car_rental_h3_font_size',
'line_height' => 'vw_car_rental_h3_line_height',
'letter_spacing' => 'vw_car_rental_h3_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
// Add the `
` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_h4_font_color', array(
'label' => esc_html__( 'Heading 4 Color', 'vw-car-rental' ),
'description' => __( 'Select how heading 4 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_h4_typography', array(
'label' => esc_html__( 'Heading 4', 'vw-car-rental' ),
'description' => __( 'Select how heading 4 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_h4_font_family',
'weight' => 'vw_car_rental_h4_font_weight',
'style' => 'vw_car_rental_h4_font_style',
'size' => 'vw_car_rental_h4_font_size',
'line_height' => 'vw_car_rental_h4_line_height',
'letter_spacing' => 'vw_car_rental_h4_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
// Add the `
` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_h5_font_color', array(
'label' => esc_html__( 'Heading 5 Color', 'vw-car-rental' ),
'description' => __( 'Select how heading 5 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_h5_typography', array(
'label' => esc_html__( 'Heading 5', 'vw-car-rental' ),
'description' => __( 'Select how heading 5 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_h5_font_family',
'weight' => 'vw_car_rental_h5_font_weight',
'style' => 'vw_car_rental_h5_font_style',
'size' => 'vw_car_rental_h5_font_size',
'line_height' => 'vw_car_rental_h5_line_height',
'letter_spacing' => 'vw_car_rental_h5_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
// Add the `
` typography control.
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'vw_car_rental_h6_font_color', array(
'label' => esc_html__( 'Heading 6 Color', 'vw-car-rental' ),
'description' => __( 'Select how heading 6 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
) ) );
$wp_customize->add_control( new VW_Car_Rental_Control_Typography( $wp_customize, 'vw_car_rental_h6_typography', array(
'label' => esc_html__( 'Heading 6', 'vw-car-rental' ),
'description' => __( 'Select how heading 6 should appear.', 'vw-car-rental' ),
'section' => 'vw_car_rental_headings_typography',
// Tie a setting (defined via `$wp_customize->add_setting()`) to the control.
'settings' => array(
'family' => 'vw_car_rental_h6_font_family',
'weight' => 'vw_car_rental_h6_font_weight',
'style' => 'vw_car_rental_h6_font_style',
'size' => 'vw_car_rental_h6_font_size',
'line_height' => 'vw_car_rental_h6_line_height',
'letter_spacing' => 'vw_car_rental_h6_letter_spacing'
),
// Pass custom labels. Use the setting key (above) for the specific label.
'l10n' => array(),
) ) );
}
/**
* Register control scripts/styles.
*
* @since 1.0.0
* @access public
* @return void
*/
function vw_car_rental_customize_controls_register_scripts() {
wp_enqueue_script( 'vw-car-rental-ctypo-customize-controls', trailingslashit( esc_url(get_template_directory_uri()) ) . 'inc/typography/js/customize-controls.js',array( 'customize-controls' ) );
wp_enqueue_style( 'vw-car-rental-ctypo-customize-controls-style', trailingslashit( esc_url(get_template_directory_uri()) ) . 'assets/css/customize-controls.css' );
}
/**
* Load preview scripts/styles.
*
* @since 1.0.0
* @access public
* @return void
*/
function vw_car_rental_customize_preview_enqueue_scripts() {
wp_enqueue_script( 'vw-car-rental-ctypo-customize-preview', trailingslashit( esc_url(get_template_directory_uri()) ) . 'inc/typography/js/customize-preview.js',array( 'jquery' ) );
}
/**
* Add custom body class to give some more weight to our styles.
*
* @since 1.0.0
* @access public
* @return void
*/
function vw_car_rental_print_styles() {
$style = $_p_style = $_a_style = $_h1_style = $_h2_style = $_h3_style = $_h4_style = $_h5_style = $_h6_style ='';
$allowed_weights = array( 100, 300, 400, 500, 700, 900 );
$allowed_styles = array( 'normal', 'italic', 'oblique' );
/* ===