id); $class = 'customize-control has-change customize-control-' . $this->type; ?>
  • render_content(); ?>
  • json['id'] = $this->id; $this->json['avik_padding_f_c'] = $this->avik_padding_f_c(); $this->json['title'] = esc_html__('Link values together', 'avik'); $this->json['inputAttrs'] = ''; foreach ($this->input_attrs as $attr => $value) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr($value) . '" '; } $this->json['desktop'] = array(); $this->json['tablet'] = array(); $this->json['mobile'] = array(); foreach ($this->settings as $setting_key => $setting) { list($_key) = explode('_', $setting_key); $this->json[$_key][$setting_key] = array( 'id' => $setting->id, 'link' => $this->get_link($setting_key), 'value' => $this->value($setting_key), ); } } protected function content_template() { ?> <# if ( data.label ) { #> {{{ data.label }}} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #> esc_attr__('Top', 'avik'), 'desktop_right' => esc_attr__('Right', 'avik'), 'desktop_bottom' => esc_attr__('Bottom', 'avik'), 'desktop_left' => esc_attr__('Left', 'avik'), 'tablet_top' => esc_attr__('Top', 'avik'), 'tablet_right' => esc_attr__('Right', 'avik'), 'tablet_bottom' => esc_attr__('Bottom', 'avik'), 'tablet_left' => esc_attr__('Left', 'avik'), 'mobile_top' => esc_attr__('Top', 'avik'), 'mobile_right' => esc_attr__('Right', 'avik'), 'mobile_bottom' => esc_attr__('Bottom', 'avik'), 'mobile_left' => esc_attr__('Left', 'avik'), 'desktop_font' => esc_html__('Font size', 'avik'), 'tablet_font' => esc_html__('Font size', 'avik'), 'mobile_font' => esc_html__('Font size', 'avik'), 'desktop_width' => esc_html__('Width', 'avik'), 'tablet_width' => esc_html__('Width', 'avik'), 'mobile_width' => esc_html__('Width', 'avik'), 'desktop_height' => esc_html__('Height', 'avik'), 'tablet_height' => esc_html__('Height', 'avik'), 'mobile_height' => esc_html__('Height', 'avik'), 'desktop_font_size' => esc_html__('Font Size', 'avik'), 'tablet_font_size' => esc_html__('Font Size', 'avik'), 'mobile_font_size' => esc_html__('Font Size', 'avik'), 'desktop_line_height' => esc_html__('Line Height', 'avik'), 'tablet_line_height' => esc_html__('Line Height', 'avik'), 'mobile_line_height' => esc_html__('Line Height', 'avik'), 'desktop_letter_spacing' => esc_html__('Letter Spacingt', 'avik'), 'tablet_letter_spacing' => esc_html__('Letter Spacing', 'avik'), 'mobile_letter_spacing' => esc_html__('Letter Spacing', 'avik'), 'desktop_padding' => esc_html__('Padding', 'avik'), 'tablet_padding' => esc_html__('Padding', 'avik'), 'mobile_padding' => esc_html__('Padding', 'avik'), 'desktop_height' => esc_html__('Height', 'avik'), 'tablet_height' => esc_html__('Height', 'avik'), 'mobile_height' => esc_html__('Height', 'avik'), ); if (false === $id) { return $translation_strings; } return $translation_strings[$id]; } } } /* ------------------------------------* ## 1.1 Class Toggle Switchs */ /* ----------------------------------- */ if (class_exists('WP_Customize_Control')) { class Avik_Toggle_Switch_Custom_control extends WP_Customize_Control { /** * The type of control being rendered */ public $type = 'toogle_switch'; /** * Enqueue our scripts and styles */ public function enqueue() { wp_enqueue_style('avik_custom_controls_css', trailingslashit(get_template_directory_uri()) . 'inc/css/avik-customizer.css', array(), '1.0', 'all'); } /** * Render the control in the customizer */ public function render_content() { ?>
    link(); checked($this->value()); ?>>
    label); ?> description)) { ?> description); ?>
    array( 'href' => array(), 'title' => array(), 'class' => array(), 'target' => array(), ), 'br' => array(), 'em' => array(), 'strong' => array(), 'i' => array( 'class' => array() ), 'span' => array( 'class' => array(), ), 'code' => array(), ); ?>
    label)) { ?> label); ?> description)) { ?> description, $allowed_html); ?>
    '_customize-dropdown-category-' . $this->id, 'echo' => 0, 'show_count' => 1, 'show_option_none' => __('— Select —', 'avik'), 'option_none_value' => 0, 'selected' => $this->value(), ) ); $dropdown = str_replace('get_link(), $dropdown); printf( '', $this->label, $dropdown ); } } } /* ------------------------------------* ## 1.2/B Dropdown Posts Custom Control */ /* ----------------------------------- */ if (class_exists('WP_Customize_Control')) { class Avik_Dropdown_Posts_Custom_Control extends WP_Customize_Control { /** * The type of control being rendered */ public $type = 'dropdown_posts'; /** * Posts */ private $posts = array(); /** * Constructor */ public function __construct($manager, $id, $args = array(), $options = array()) { parent::__construct($manager, $id, $args); // Get our Posts $this->posts = get_posts($this->input_attrs); } /** * Render the control in the customizer */ public function render_content() { ?> title, ENT_QUOTES, get_bloginfo('charset')); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; return $array; } } } if (class_exists('WP_Customize_Section')) { class Avik_WP_Customize_Section extends WP_Customize_Section { public $section; public $type = 'pe_section'; public function json() { $array = wp_array_slice_assoc((array) $this, array('id', 'description', 'priority', 'panel', 'type', 'description_hidden', 'section',)); $array['title'] = html_entity_decode($this->title, ENT_QUOTES, get_bloginfo('charset')); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; if ($this->panel) { $array['customizeAction'] = sprintf('Customizing ▸ %s', esc_html($this->manager->get_panel($this->panel)->title)); } else { $array['customizeAction'] = 'Customizing'; } return $array; } } } /* ------------------------------------* ## 1.4 Class TinyMCE */ /* ----------------------------------- */ if (class_exists('WP_Customize_Control')) { class Avik_TinyMCE_Custom_control extends WP_Customize_Control { /** * The type of control being rendered */ public $type = 'tinymce_editor'; /** * Enqueue our scripts and styles */ public function enqueue() { wp_enqueue_script('avik_custom_controls_js', trailingslashit(get_template_directory_uri()) . 'inc/js/avik-class-customizer.js', array('jquery'), '1.0', true); wp_enqueue_style('avik_custom_controls_css', trailingslashit(get_template_directory_uri()) . 'inc/css/avik-customizer.css', array(), '1.0', 'all'); wp_enqueue_editor(); } /** * Pass our TinyMCE toolbar string to JavaScript */ public function to_json() { parent::to_json(); $this->json['skyrockettinymcetoolbar1'] = isset($this->input_attrs['toolbar1']) ? esc_js($this->input_attrs['toolbar1']) : 'bold italic bullist numlist alignleft aligncenter alignright link'; $this->json['skyrockettinymcetoolbar2'] = isset($this->input_attrs['toolbar2']) ? esc_js($this->input_attrs['toolbar2']) : ''; } /** * Render the control in the customizer */ public function render_content() { ?>
    label); ?> description)) { ?> description); ?>
    * @license http://www.gnu.org/licenses/gpl-2.0.html * @link https://github.com/maddisondesigns */ if (class_exists('WP_Customize_Control')) { class Avik_Customize_Alpha_Color_Control extends WP_Customize_Control { public $type = 'alpha-color'; public $palette; public $show_opacity; public function enqueue() { wp_enqueue_script('avik_custom_controls_js', trailingslashit(get_template_directory_uri()) . 'inc/js/avik-class-customizer.js', array('jquery', 'wp-color-picker'), '1.0', true); wp_enqueue_style('avik_custom_controls_css', trailingslashit(get_template_directory_uri()) . 'inc/css/avik-customizer.css', array('wp-color-picker'), '1.0', 'all'); } public function render_content() { if (is_array($this->palette)) { $palette = implode('|', $this->palette); } else { $palette = (false === $this->palette || 'false' === $this->palette) ? 'false' : 'true'; } $show_opacity = (false === $this->show_opacity || 'false' === $this->show_opacity) ? 'false' : 'true'; ?> link(); ?> />
    label); ?>link(); ?> />
    array( 'href' => array(), 'title' => array(), 'class' => array(), 'target' => array(), ), 'br' => array(), 'em' => array(), 'hr' => array(), 'strong' => array(), 'i' => array( 'class' => array() ), 'button' => array( 'class' => array() ), 'div' => array( 'style' => array() ), 'p' => array( 'style' => array() ), 'span' => array( 'class' => array(), ), 'code' => array(), ); ?>
    label)) { ?> label); ?> description)) { ?> description, $allowed_html); ?>
    esc_html__('Header', 'avik'), 'whoweare' => esc_html__('Who we Are', 'avik'), 'services' => esc_html__('Services', 'avik'), 'portfolio' => esc_html__('Portfolio', 'avik'), 'blog' => esc_html__('Blog', 'avik'), 'contact' => esc_html__('Contact', 'avik'), )); // Return elements return $avik_elements_sections_home; } } /* Sortable control ========================================================================== */ if (class_exists('WP_Customize_Control')) { class Avik_Customizer_Sortable_Control extends WP_Customize_Control { public $type = 'bubi-sortable'; /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { wp_enqueue_script('avik-sortable', trailingslashit(get_template_directory_uri()) . 'inc/js/avik-sortable.js', array('jquery', 'customize-base', 'jquery-ui-core', 'jquery-ui-sortable'), false, true); wp_enqueue_style('avik-sortable', trailingslashit(get_template_directory_uri()) . 'inc/css/avik-sortable.css', null); } public function to_json() { parent::to_json(); $this->json['default'] = $this->setting->default; if (isset($this->default)) { $this->json['default'] = $this->default; } $this->json['value'] = maybe_unserialize($this->value()); $this->json['choices'] = $this->choices; $this->json['link'] = $this->get_link(); $this->json['id'] = $this->id; $this->json['inputAttrs'] = ''; foreach ($this->input_attrs as $attr => $value) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr($value) . '" '; } $this->json['inputAttrs'] = maybe_serialize($this->input_attrs()); } protected function content_template() { ?> manager->get_control($setting->id)->choices; $input_keys = $input; foreach ($input_keys as $key => $value) { if (!array_key_exists($value, $choices)) { unset($input[$key]); } } // If the input is a valid key, return it; // otherwise, return the default. return (is_array($input) ? $input : $setting->default); } } /* Notice Info */ if (class_exists('WP_Customize_Control')) { class Avik_Info_Notice_Custom_Control extends WP_Customize_Control { /** * The type of control being rendered */ public $type = 'simple_notice'; /** * Render the control in the customizer */ public function render_content() { $allowed_html = array( 'a' => array( 'href' => array(), 'title' => array(), 'class' => array(), 'target' => array(), ), 'br' => array(), 'em' => array(), 'strong' => array(), 'i' => array( 'class' => array() ), 'span' => array( 'class' => array(), ), 'code' => array(), ); ?>
    label)) { ?> label); ?>

    description)) { ?> description, $allowed_html); ?>
    array( 'href' => array(), 'title' => array(), 'class' => array(), 'target' => array(), ), 'br' => array(), 'em' => array(), 'strong' => array(), 'i' => array( 'class' => array() ), 'span' => array( 'class' => array(), ), 'code' => array(), ); ?>
    label)) { ?> label); ?> description)) { ?> description, $allowed_html); ?>
    manager->get_setting('avik_enable_team_whoweare'); return $option->value() == 'avik_title_general_team_whoweare'; return $option->value() == 'avik_color_social_icons_team'; return $option->value() == 'avik_color_hover_social_icons_team'; } /* --------------------------------------* ## 3.2 Social Team Who we are */ /* -------------------------------------- */ // avik_Enable Icon Facebook 1 function avik_enable_facebook_icon_team_1($control) { $option = $control->manager->get_setting('avik_enable_facebook_icon_team_1'); return $option->value() == 'avik_link_facebook_icon_team_1'; } // Enable Icon Twitter 1 function avik_enable_twitter_icon_team_1($control) { $option = $control->manager->get_setting('avik_enable_twitter_icon_team_1'); return $option->value() == 'avik_link_twitter_icon_team_1'; } // Enable Icon Instagram 1 function avik_enable_instagram_icon_team_1($control) { $option = $control->manager->get_setting('avik_enable_instagram_icon_team_1'); return $option->value() == 'avik_link_instagram_icon_team_1'; } // Enable Icon Linkedin 1 function avik_enable_linkedin_icon_team_1($control) { $option = $control->manager->get_setting('avik_enable_linkedin_icon_team_1'); return $option->value() == 'avik_link_linkedin_icon_team_1'; } // Enable Google Plus 1 function avik_enable_google_plus_icon_team_1($control) { $option = $control->manager->get_setting('avik_enable_google_plus_icon_team_1'); return $option->value() == 'avik_link_google_plus_icon_team_1'; } // avik_Enable Icon Facebook 2 function avik_enable_facebook_icon_team_2($control) { $option = $control->manager->get_setting('avik_enable_facebook_icon_team_2'); return $option->value() == 'avik_link_facebook_icon_team_2'; } // Enable Icon Twitter 2 function avik_enable_twitter_icon_team_2($control) { $option = $control->manager->get_setting('avik_enable_twitter_icon_team_2'); return $option->value() == 'avik_link_twitter_icon_team_2'; } // Enable Icon Instagram 2 function avik_enable_instagram_icon_team_2($control) { $option = $control->manager->get_setting('avik_enable_instagram_icon_team_2'); return $option->value() == 'avik_link_instagram_icon_team_2'; } // Enable Icon Linkedin 2 function avik_enable_linkedin_icon_team_2($control) { $option = $control->manager->get_setting('avik_enable_linkedin_icon_team_2'); return $option->value() == 'avik_link_linkedin_icon_team_2'; } // Enable Google Plus 2 function avik_enable_google_plus_icon_team_2($control) { $option = $control->manager->get_setting('avik_enable_google_plus_icon_team_2'); return $option->value() == 'avik_link_google_plus_icon_team_2'; } // Enable Icon Facebook 3 function avik_enable_facebook_icon_team_3($control) { $option = $control->manager->get_setting('avik_enable_facebook_icon_team_3'); return $option->value() == 'avik_link_facebook_icon_team_3'; } // Enable Icon Twitter 3 function avik_enable_twitter_icon_team_3($control) { $option = $control->manager->get_setting('avik_enable_twitter_icon_team_3'); return $option->value() == 'avik_link_twitter_icon_team_3'; } // Enable Icon Instagram 3 function avik_enable_instagram_icon_team_3($control) { $option = $control->manager->get_setting('avik_enable_instagram_icon_team_3'); return $option->value() == 'avik_link_instagram_icon_team_3'; } // Enable Icon Linkedin 3 function avik_enable_linkedin_icon_team_3($control) { $option = $control->manager->get_setting('avik_enable_linkedin_icon_team_3'); return $option->value() == 'avik_link_linkedin_icon_team_3'; } // Enable Google Plus 3 function avik_enable_google_plus_icon_team_3($control) { $option = $control->manager->get_setting('avik_enable_google_plus_icon_team_3'); return $option->value() == 'avik_link_google_plus_icon_team_3'; } /* --------------------------------------* ## 3.3 Blog */ /* -------------------------------------- */ // Enable carousel Blog function avik_enable_carousel($control) { $option = $control->manager->get_setting('avik_enable_carousel'); return $option->value() == 'avik_carousel_category'; return $option->value() == 'avik_carousel_count'; } /* --------------------------------------* ## 3.4 Social */ /* -------------------------------------- */ // Facebook function avik_enable_facebook_social($control) { $option = $control->manager->get_setting('avik_enable_facebook_social'); return $option->value() == 'avik_link_facebook_social'; } // Twitter function avik_enable_twitter_social($control) { $option = $control->manager->get_setting('avik_enable_twitter_social'); return $option->value() == 'avik_link_twitter_social'; } // Google Plus function avik_enable_google_plus_social($control) { $option = $control->manager->get_setting('avik_enable_google_plus_social'); return $option->value() == 'avik_link_google_plus_social'; } // Dribbble function avik_enable_dribbble_social($control) { $option = $control->manager->get_setting('avik_enable_dribbble_social'); return $option->value() == 'avik_link_dribbble_social'; } // Tumblr function avik_enable_tumblr_social($control) { $option = $control->manager->get_setting('avik_enable_tumblr_social'); return $option->value() == 'avik_link_tumblr_social'; } // Instagram function avik_enable_instagram_social($control) { $option = $control->manager->get_setting('avik_enable_instagram_social'); return $option->value() == 'avik_link_instagram_social'; } // Linkedin function avik_enable_linkedin_social($control) { $option = $control->manager->get_setting('avik_enable_linkedin_social'); return $option->value() == 'avik_link_linkedin_social'; } // Youtube function avik_enable_youtube_social($control) { $option = $control->manager->get_setting('avik_enable_youtube_social'); return $option->value() == 'avik_link_youtube_social'; } // Pinterest function avik_enable_pinterest_social($control) { $option = $control->manager->get_setting('avik_enable_pinterest_social'); return $option->value() == 'avik_link_pinterest_social'; } // Flickr function avik_enable_flickr_social($control) { $option = $control->manager->get_setting('avik_enable_flickr_social'); return $option->value() == 'avik_link_flickr_social'; } // Github function avik_enable_github_social($control) { $option = $control->manager->get_setting('avik_enable_github_social'); return $option->value() == 'avik_link_github_social'; } /* Notice Header */ function avik_select_header_layout() { if ( 'block' == get_theme_mod('avik_order_header_home', 'block') ) { return true; } else { return false; } } function avik_select_header_layout_img() { if ( 'block' == get_theme_mod('avik_order_header_home', 'block') || 'page-slider' == get_theme_mod('avik_order_header_home', 'page-slider') ) { return false; } else { return true; } } function avik_select_header_layout_slider() { if ( 'page-slider' == get_theme_mod('avik_order_header_home', 'page-slider') || 'page-static' == get_theme_mod('avik_order_header_home', 'page-static') ) { return true; } else { return false; } } function avik_select_header_layout_sl() { if ( 'page-slider' == get_theme_mod('avik_order_header_home', 'page-slider') ) { return true; } else { return false; } } /* Who we Are Section Homepage */ function avik_enable_second_image_whoweare() { if (get_theme_mod('avik_enable_second_image_whoweare', true)) { return false; } else { return true; } } /* Contact Section */ function avik_enable_social_contact() { if (get_theme_mod('avik_enable_social_contact', true)) { return false; } else { return true; } } function avik_enable_image_contact() { if (get_theme_mod('avik_enable_image_contact', false)) { return false; } else { return true; } } function avik_enable_cursor_whoweare() { if (get_theme_mod('avik_enable_cursor_whoweare', false)) { return false; } else { return true; } } function avik_enable_sec_imgpage_whoweare() { if (get_theme_mod('avik_enable_sec_imgpage_whoweare', false)) { return false; } else { return true; } } function avik_enable_cursor_services_page() { if (get_theme_mod('avik_enable_cursor_services_page', false)) { return false; } else { return true; } } function avik_enable_header_page_canva() { if (get_theme_mod('avik_enable_header_page_canva', false)) { return false; } else { return true; } } /* --------------------------------------* ## 3.5 Filter Header Home */ /* -------------------------------------- */ // Color Filter Header Home function avik_enable_filter_home($control) { $option = $control->manager->get_setting('avik_enable_filter_home'); return $option->value() == 'avik_color_filter_header'; } /* ------------------------------------------------------------------------- * ## 4 General Sanitization */ /* ------------------------------------------------------------------------- */ /* ----------------------------------------------- * ## 4.1 Image Sanitization */ /* ------------------------------------------------*/ if (!function_exists('avik_sanitize_file')) { function avik_sanitize_file($file, $setting) { //allowed file types $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'mp4' => 'video/mp4', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon', ); //check file type from file name $file_ext = wp_check_filetype($file, $mimes); //if file has a valid mime type return it, otherwise return default return ($file_ext['ext'] ? $file : $setting->default); } } /* ----------------------------------------------- * ## 4.2 Toggle switch Sanitization */ /* ------------------------------------------------*/ if (!function_exists('avik_switch_sanitization')) { function avik_switch_sanitization($input) { if (true === $input) { return 1; } else { return 0; } } } /* ----------------------------------------------- * ## 4.3 Dropwown Pages Sanitization */ /* ------------------------------------------------*/ function avik_sanitize_dropdown_pages($page_id, $setting) { $page_id = absint($page_id); return ('publish' == get_post_status($page_id) ? $page_id : $setting->default); } /* ----------------------------------------------- * ## 4.4 Dropwown Categoryes Sanitization */ /* ------------------------------------------------*/ function avik_sanitize_category_select($cat_id, $setting) { $cat_id = absint($cat_id); return is_string(get_the_category_by_ID($cat_id)) ? $cat_id : $setting->default; } /* ----------------------------------------------- * ## 4.5 Select sanitization function */ /* ------------------------------------------------*/ function avik_sanitize_select($input, $setting) { //input must be a slug: lowercase alphanumeric characters, dashes and underscores are allowed only $input = sanitize_key($input); //get the list of possible select options $choices = $setting->manager->get_control($setting->id)->choices; //return input if valid or return default option return (array_key_exists($input, $choices) ? $input : $setting->default); } /* ----------------------------------------------- * ## 4.6 Alpha Color Sanitization */ /* ------------------------------------------------*/ /** *@param string Input to be sanitized *@return string Sanitized input */ if (!function_exists('avik_hex_rgba_sanitization')) { function avik_hex_rgba_sanitization($input, $setting) { if (empty($input) || is_array($input)) { return $setting->default; } if (false === strpos($input, 'rgba')) { $input = sanitize_hex_color($input); } else { $input = str_replace(' ', '', $input); sscanf($input, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha); $input = 'rgba(' . avik_in_range($red, 0, 255) . ',' . avik_in_range($green, 0, 255) . ',' . avik_in_range($blue, 0, 255) . ',' . avik_in_range($alpha, 0, 1) . ')'; } return $input; } } /** * @param number Input to be sanitized * @return number Sanitized input */ if (!function_exists('avik_in_range')) { function avik_in_range($input, $min, $max) { if ($input < $min) { $input = $min; } if ($input > $max) { $input = $max; } return $input; } } /* ----------------------------------------------- * ## 4.7 Slider custom control Sanitization */ /* ------------------------------------------------*/ /** * @param string Input value to check * @return integer Returned integer value */ if (!function_exists('avik_sanitize_integer')) { function avik_sanitize_integer($input) { return (int) $input; } } /* ----------------------------------------------- * ## 4.8 Text custom control Sanitization */ /* ------------------------------------------------*/ if (!function_exists('avik_text_sanitization')) { function avik_text_sanitization($input) { if (strpos($input, ',') !== false) { $input = explode(',', $input); } if (is_array($input)) { foreach ($input as $key => $value) { $input[$key] = sanitize_text_field($value); } $input = implode(',', $input); } else { $input = sanitize_text_field($input); } return $input; } } /* ----------------------------------------------- * ## 4.9 - Number Sanitization */ /* ------------------------------------------------*/ function avik_sanitize_number($val) { return is_numeric($val) ? $val : 0; }