Cleanup: Remoción masiva de restos de WordPress y consolidación de archivos GKACHELE™

This commit is contained in:
komkida91
2026-01-27 18:00:16 +01:00
parent d9aad67066
commit 7083aa3893
874 changed files with 137670 additions and 137443 deletions

View File

@@ -0,0 +1,61 @@
<?php
// Checkbox sanitization
function abiz_sanitize_checkbox( $checked ) {
// Boolean check.
return ( ( isset( $checked ) && true == $checked ) ? true : false );
}
// HTML sanitization
function abiz_sanitize_html( $html ) {
return wp_kses_post( force_balance_tags( $html ) );
}
// Number sanitization
function abiz_sanitize_number_absint( $number, $setting ) {
// Ensure $number is an absolute integer (whole number, zero or greater).
$number = absint( $number );
// If the input is an absolute integer, return it; otherwise, return the default
return ( $number ? $number : $setting->default );
}
// Select sanitization callback example.
function abiz_sanitize_select( $input, $setting ) {
// Ensure input is a slug.
$input = sanitize_key( $input );
// Get list of choices from the control associated with the setting.
$choices = $setting->manager->get_control( $setting->id )->choices;
// If the input is a valid key, return it; otherwise, return the default.
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
// URL sanitization
function abiz_sanitize_url( $url ) {
return esc_url_raw( $url );
}
// Sanitization Text
function abiz_sanitize_text( $text ) {
return wp_filter_post_kses( $text );
}
// Sanitize Sortable control.
function abiz_sanitize_sortable( $val, $setting ) {
if ( is_string( $val ) || is_numeric( $val ) ) {
return array(
esc_attr( $val ),
);
}
$sanitized_value = array();
foreach ( $val as $item ) {
if ( isset( $setting->manager->get_control( $setting->id )->choices[ $item ] ) ) {
$sanitized_value[] = esc_attr( $item );
}
}
return $sanitized_value;
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* Get default option by passing option id
*/
if ( !function_exists( 'abiz_get_default_option' ) ):
function abiz_get_default_option( $option ) {
if ( empty( $option ) ) {
return false;
}
$abiz_default_options = array(
'logo_size' => '150',
'site_ttl_font_size' => '30',
'site_desc_font_size' => '14',
'enable_top_hdr' => '1',
'enable_top_hdr' => '1',
'enable_hdr_info1' => '1',
'hdr_info1_icon' => 'fas fa-envelope',
'hdr_info1_title' => __('info@example.com', 'abiz'),
'hdr_info1_link' => '#',
'enable_hdr_info2' => '1',
'hdr_info2_icon' => 'fas fa-phone',
'hdr_info2_title' => __('+123 456 7890', 'abiz'),
'hdr_info2_link' => '#',
'enable_hdr_info3' => '1',
'hdr_info3_icon' => 'fas fa-location-arrow',
'hdr_info3_title' => __('California, TX 70240', 'abiz'),
'hdr_info3_link' => '#',
'enable_social_icon' => '1',
'hdr_social_icons' => abiz_get_social_icon_default(),
'enable_cart' => '1',
'enable_nav_search' => '1',
'enable_account' => '1',
'enable_hdr_btn' => '1',
'hdr_btn_label' => __('Get in Touch', 'abiz'),
'hdr_btn_link' => '#',
'enable_hdr_sticky' => '1',
'enable_scroller' => '1',
'top_scroller_icon' => 'fas fa-angle-up',
'enable_page_header' => '1',
'page_header_img_opacity' => '0.75',
'page_header_bg_color' => '#e11c09',
'blog_archive_ordering' => array(
'meta',
'title',
'content',
),
'enable_blog_excerpt' => '1',
'blog_excerpt_length' => '40',
'blog_excerpt_after_text' => '&hellip;',
'enable_blog_excerpt_btn' => '1',
'blog_excerpt_btn_label' => __('Read More', 'abiz'),
'enable_top_footer' => '1',
'footer_top_info' => abiz_footer_top_default(),
'footer_copyright' => wp_kses_post(sprintf( __( 'Copyright &copy; {current_year}. Created by %s. Powered by %s.', 'abiz' ), '<a href="#" target="_blank" rel="noopener">Themes Daddy</a>', '<a href="https://www.wordpress.org" target="_blank" rel="noopener">WordPress</a>' )),
'abiz_body_font_size' => '16',
);
$abiz_default_options = apply_filters( 'abiz_modify_default_options', $abiz_default_options );
if ( isset( $abiz_default_options[$option] ) ) {
return $abiz_default_options[$option];
}
return false;
}
endif;
?>

View File

@@ -0,0 +1,961 @@
<?php
function abiz_general_customize($wp_customize)
{
$selective_refresh = isset($wp_customize->selective_refresh) ? 'postMessage' : 'refresh';
/*=========================================
Site Identity
=========================================*/
$wp_customize->add_setting('logo_size', array(
'default' => abiz_get_default_option( 'logo_size' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => 'postMessage',
));
$wp_customize->add_control('logo_size', array(
'label' => __('Logo Size', 'abiz') ,
'section' => 'title_tagline',
'type' => 'number',
));
// Site Title//
$wp_customize->add_setting('site_ttl_font_size', array(
'default' => abiz_get_default_option( 'site_ttl_font_size' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => 'postMessage',
));
$wp_customize->add_control('site_ttl_font_size', array(
'label' => __('Site Title Font Size', 'abiz') ,
'section' => 'title_tagline',
'type' => 'number',
));
// Site Description Font Size//
$wp_customize->add_setting('site_desc_font_size', array(
'default' => abiz_get_default_option( 'site_desc_font_size' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => 'postMessage',
));
$wp_customize->add_control('site_desc_font_size', array(
'label' => __('Site Description Font Size', 'abiz') ,
'section' => 'title_tagline',
'type' => 'number',
));
/*=========================================
Top Header Section
=========================================*/
/*=========================================
Setting
=========================================*/
$wp_customize->add_setting('top_hdr_set', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('top_hdr_set', array(
'type' => 'hidden',
'label' => __('Setting', 'abiz') ,
'section' => 'top_header',
'priority' => 1,
));
// Enable / Disable
$wp_customize->add_setting('enable_top_hdr', array(
'default' => abiz_get_default_option( 'enable_top_hdr' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_top_hdr', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'top_header',
'priority' => 2,
)));
/*=========================================
Info 1
=========================================*/
$wp_customize->add_setting('hdr_info1_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('hdr_info1_head', array(
'type' => 'hidden',
'label' => __('Info 1', 'abiz') ,
'section' => 'top_header',
'priority' => 2,
));
// hide/show
$wp_customize->add_setting('enable_hdr_info1', array(
'default' => abiz_get_default_option( 'enable_hdr_info1' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_hdr_info1', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'top_header',
'priority' => 2,
)));
// icon //
$wp_customize->add_setting('hdr_info1_icon', array(
'default' => abiz_get_default_option( 'hdr_info1_icon' ),
'sanitize_callback' => 'sanitize_text_field',
'capability' => 'edit_theme_options',
));
$wp_customize->add_control('hdr_info1_icon', array(
'label' => __('Icon', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 3,
));
// title //
$wp_customize->add_setting('hdr_info1_title', array(
'default' => abiz_get_default_option( 'hdr_info1_title' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => $selective_refresh,
));
$wp_customize->add_control('hdr_info1_title', array(
'label' => __('Title', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 3,
));
// Link //
$wp_customize->add_setting('hdr_info1_link', array(
'default' => abiz_get_default_option( 'hdr_info1_link' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_url',
));
$wp_customize->add_control('hdr_info1_link', array(
'label' => __('Link', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 3,
));
/*=========================================
Info 2
=========================================*/
$wp_customize->add_setting('hdr_info2_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('hdr_info2_head', array(
'type' => 'hidden',
'label' => __('Info 2', 'abiz') ,
'section' => 'top_header',
'priority' => 4,
));
// hide/show
$wp_customize->add_setting('enable_hdr_info2', array(
'default' => abiz_get_default_option( 'enable_hdr_info2' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_hdr_info2', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'top_header',
'priority' => 5,
)));
// icon //
$wp_customize->add_setting('hdr_info2_icon', array(
'default' => abiz_get_default_option( 'hdr_info2_icon' ),
'sanitize_callback' => 'sanitize_text_field',
'capability' => 'edit_theme_options',
));
$wp_customize->add_control('hdr_info2_icon', array(
'label' => __('Icon', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 6,
));
// title //
$wp_customize->add_setting('hdr_info2_title', array(
'default' => abiz_get_default_option( 'hdr_info2_title' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => $selective_refresh,
));
$wp_customize->add_control('hdr_info2_title', array(
'label' => __('Title', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 7,
));
// Link //
$wp_customize->add_setting('hdr_info2_link', array(
'default' => abiz_get_default_option( 'hdr_info2_link' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_url',
));
$wp_customize->add_control('hdr_info2_link', array(
'label' => __('Link', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 8,
));
/*=========================================
Info 3
=========================================*/
$wp_customize->add_setting('hdr_info3_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('hdr_info3_head', array(
'type' => 'hidden',
'label' => __('Info 3', 'abiz') ,
'section' => 'top_header',
'priority' => 9,
));
// hide/show
$wp_customize->add_setting('enable_hdr_info3', array(
'default' => abiz_get_default_option( 'enable_hdr_info3' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_hdr_info3', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'top_header',
'priority' => 10,
)));
// icon //
$wp_customize->add_setting('hdr_info3_icon', array(
'default' => abiz_get_default_option( 'hdr_info3_icon' ),
'sanitize_callback' => 'sanitize_text_field',
'capability' => 'edit_theme_options',
));
$wp_customize->add_control('hdr_info3_icon', array(
'label' => __('Icon', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 11,
));
// title //
$wp_customize->add_setting('hdr_info3_title', array(
'default' => abiz_get_default_option( 'hdr_info3_title' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => $selective_refresh,
));
$wp_customize->add_control('hdr_info3_title', array(
'label' => __('Title', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 12,
));
// Link //
$wp_customize->add_setting('hdr_info3_link', array(
'default' => abiz_get_default_option( 'hdr_info3_link' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_url',
));
$wp_customize->add_control('hdr_info3_link', array(
'label' => __('Link', 'abiz') ,
'section' => 'top_header',
'type' => 'text',
'priority' => 13,
));
/*=========================================
Social
=========================================*/
$wp_customize->add_setting('hdr_social_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('hdr_social_head', array(
'type' => 'hidden',
'label' => __('Social Icon', 'abiz') ,
'section' => 'top_header',
'priority' => 15,
));
$wp_customize->add_setting('enable_social_icon', array(
'default' => abiz_get_default_option( 'enable_social_icon' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_social_icon', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'top_header',
'priority' => 16,
)));
/**
* Customizer Repeater
*/
$wp_customize->add_setting('hdr_social_icons', array(
'default' => abiz_get_default_option( 'hdr_social_icons' ),
'sanitize_callback' => 'abiz_repeater_sanitize',
));
$wp_customize->add_control(new ABIZ_Repeater($wp_customize, 'hdr_social_icons', array(
'label' => esc_html__('Social Icons', 'abiz') ,
'priority' => 17,
'section' => 'top_header',
'customizer_repeater_icon_control' => true,
'customizer_repeater_link_control' => true,
)));
// Upgrade
if (class_exists('Daddy_Plus_Customize_Upgrade_Control'))
{
$wp_customize->add_setting('abiz_social_icon_upgrade',array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(new Daddy_Plus_Customize_Upgrade_Control($wp_customize,
'abiz_social_icon_upgrade',
array(
'label' => __( 'Social Icons', 'abiz' ),
'section' => 'top_header',
'priority' => 17,
)
)
);
}
/*=========================================
Header Navigation
=========================================*/
// Cart
$wp_customize->add_setting('hdr_nav_cart', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('hdr_nav_cart', array(
'type' => 'hidden',
'label' => __('Cart', 'abiz') ,
'section' => 'header_nav',
'priority' => 2,
));
// hide/show
$wp_customize->add_setting('enable_cart', array(
'default' => abiz_get_default_option( 'enable_cart' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_cart', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'header_nav',
'priority' => 2,
)));
// Account
$wp_customize->add_setting('hdr_nav_account', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('hdr_nav_account', array(
'type' => 'hidden',
'label' => __('Account', 'abiz') ,
'section' => 'header_nav',
'priority' => 3,
));
// hide/show
$wp_customize->add_setting('enable_account', array(
'default' => abiz_get_default_option( 'enable_account' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_account', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'header_nav',
'priority' => 3,
)));
// Search
$wp_customize->add_setting('hdr_nav_search_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('hdr_nav_search_head', array(
'type' => 'hidden',
'label' => __('Search', 'abiz') ,
'section' => 'header_nav',
'priority' => 3,
));
// hide/show
$wp_customize->add_setting('enable_nav_search', array(
'default' => abiz_get_default_option( 'enable_nav_search' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_nav_search', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'header_nav',
'priority' => 3,
)));
// Header Button
$wp_customize->add_setting('abv_hdr_btn_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('abv_hdr_btn_head', array(
'type' => 'hidden',
'label' => __('Button', 'abiz') ,
'section' => 'header_nav',
'priority' => 18,
));
$wp_customize->add_setting('enable_hdr_btn', array(
'default' => abiz_get_default_option( 'enable_hdr_btn' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_hdr_btn', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'header_nav',
'priority' => 19,
)));
// Button Label //
$wp_customize->add_setting('hdr_btn_label', array(
'default' => abiz_get_default_option( 'hdr_btn_label' ),
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => $selective_refresh,
'capability' => 'edit_theme_options',
));
$wp_customize->add_control('hdr_btn_label', array(
'label' => __('Label', 'abiz') ,
'section' => 'header_nav',
'type' => 'text',
'priority' => 21,
));
// Button URL //
$wp_customize->add_setting('hdr_btn_link', array(
'default' => abiz_get_default_option( 'hdr_btn_link' ),
'sanitize_callback' => 'abiz_sanitize_url',
'capability' => 'edit_theme_options',
));
$wp_customize->add_control('hdr_btn_link', array(
'label' => __('Link', 'abiz') ,
'section' => 'header_nav',
'type' => 'text',
'priority' => 22,
));
$wp_customize->add_setting('hdr_btn_target', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'hdr_btn_target', array(
'label' => __('Open in New Tab ?', 'abiz') ,
'section' => 'header_nav',
'priority' => 23,
)));
/*=========================================
Sticky Header
=========================================*/
// Heading
$wp_customize->add_setting('sticky_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text'
));
$wp_customize->add_control('sticky_head', array(
'type' => 'hidden',
'label' => __('Sticky Header', 'abiz') ,
'section' => 'header_nav',
'priority' => 23,
));
$wp_customize->add_setting('enable_hdr_sticky', array(
'default' => abiz_get_default_option( 'enable_hdr_sticky' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_hdr_sticky', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'header_nav',
'priority' => 24,
)));
/*=========================================
Scroller
=========================================*/
// Head
$wp_customize->add_setting('top_scroller_settings', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text'
));
$wp_customize->add_control('top_scroller_settings', array(
'type' => 'hidden',
'label' => __('Top Scroller Setting', 'abiz') ,
'section' => 'top_scroller'
));
$wp_customize->add_setting('enable_scroller', array(
'default' => abiz_get_default_option( 'enable_scroller' ),
'sanitize_callback' => 'abiz_sanitize_checkbox',
'capability' => 'edit_theme_options',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_scroller', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'top_scroller'
)));
// Scroller icon //
$wp_customize->add_setting('top_scroller_icon', array(
'default' => abiz_get_default_option( 'top_scroller_icon' ),
'sanitize_callback' => 'sanitize_text_field',
'capability' => 'edit_theme_options',
));
$wp_customize->add_control('top_scroller_icon', array(
'label' => __('Scroller Icon', 'abiz') ,
'section' => 'top_scroller',
'type' => 'text'
));
/*=========================================
Page Header
=========================================*/
// Heading
$wp_customize->add_setting('header_image_set', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
));
$wp_customize->add_control('header_image_set', array(
'type' => 'hidden',
'label' => __('Page Header', 'abiz') ,
'section' => 'header_image',
'priority' => 1,
));
// Enable / Disable
$wp_customize->add_setting('enable_page_header', array(
'default' => abiz_get_default_option( 'enable_page_header' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_page_header', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'header_image',
'priority' => 2,
)));
// Image Opacity //
$wp_customize->add_setting('page_header_img_opacity', array(
'default' => abiz_get_default_option( 'page_header_img_opacity' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'priority' => 11,
));
$wp_customize->add_control('page_header_img_opacity', array(
'label' => __('Opacity', 'abiz') ,
'section' => 'header_image',
'type' => 'number',
));
$wp_customize->add_setting('page_header_bg_color', array(
'default' => abiz_get_default_option( 'page_header_bg_color' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_hex_color',
'priority' => 12,
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'page_header_bg_color', array(
'label' => __('Overlay Color', 'abiz') ,
'section' => 'header_image',
)));
/*=========================================
Blog
=========================================*/
// Head //
$wp_customize->add_setting('blog_general_head', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
'priority' => 1,
));
$wp_customize->add_control('blog_general_head', array(
'type' => 'hidden',
'label' => __('Blog/Archive/Single', 'abiz') ,
'section' => 'blog_general',
));
$wp_customize->add_setting('blog_archive_ordering', array(
'default' => abiz_get_default_option( 'blog_archive_ordering' ),
'sanitize_callback' => 'abiz_sanitize_sortable',
'priority' => 2,
));
$wp_customize->add_control(new Abiz_Control_Sortable($wp_customize, 'blog_archive_ordering', array(
'label' => __('Drag & Drop post items to re-arrange the order and also hide and show items as per the need by clicking on the eye icon.', 'abiz') ,
'section' => 'blog_general',
'choices' => array(
'title' => __('Title', 'abiz') ,
'meta' => __('Meta', 'abiz') ,
'content' => __('Content', 'abiz') ,
) ,
)));
// Enable / Disable
$wp_customize->add_setting('enable_blog_excerpt', array(
'default' => abiz_get_default_option( 'enable_blog_excerpt' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
'priority' => 3,
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_blog_excerpt', array(
'label' => __('Enable / Disable Blog Excerpt ?', 'abiz') ,
'section' => 'blog_general',
)));
// Excerpt Length
$wp_customize->add_setting('blog_excerpt_length', array(
'default' => abiz_get_default_option( 'blog_excerpt_length' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'priority' => 3,
));
$wp_customize->add_control('blog_excerpt_length', array(
'label' => __('Blog Excerpt Length', 'abiz') ,
'section' => 'blog_general',
'type' => 'number',
));
// Excerpt Text //
$wp_customize->add_setting('blog_excerpt_after_text', array(
'default' => abiz_get_default_option( 'blog_excerpt_after_text' ),
'sanitize_callback' => 'abiz_sanitize_html',
'capability' => 'edit_theme_options',
'priority' => 3,
));
$wp_customize->add_control('blog_excerpt_after_text', array(
'label' => __('Blog Excerpt Text', 'abiz') ,
'section' => 'blog_general',
'type' => 'text'
));
// Enable / Disable
$wp_customize->add_setting('enable_blog_excerpt_btn', array(
'default' => abiz_get_default_option( 'enable_blog_excerpt_btn' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
'priority' => 3,
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_blog_excerpt_btn', array(
'label' => __('Enable / Disable Blog Excerpt Button ?', 'abiz') ,
'section' => 'blog_general',
)));
// Button Label //
$wp_customize->add_setting('blog_excerpt_btn_label', array(
'default' => abiz_get_default_option( 'blog_excerpt_btn_label' ),
'sanitize_callback' => 'abiz_sanitize_html',
'capability' => 'edit_theme_options',
'priority' => 5,
));
$wp_customize->add_control('blog_excerpt_btn_label', array(
'label' => __('Blog Excerpt Button Label', 'abiz') ,
'section' => 'blog_general',
'type' => 'text'
));
/*=========================================
Footer
=========================================*/
/*=========================================
Footer Top
=========================================*/
// Head //
$wp_customize->add_setting('footer_top_heading', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
'priority' => 1,
));
$wp_customize->add_control('footer_top_heading', array(
'type' => 'hidden',
'label' => __('Footer Top', 'abiz') ,
'section' => 'footer_section',
));
// Enable / Disable
$wp_customize->add_setting('enable_top_footer', array(
'default' => abiz_get_default_option( 'enable_top_footer' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_checkbox',
'priority' => 2,
));
$wp_customize->add_control(new Abiz_Customize_Toggle_Control($wp_customize, 'enable_top_footer', array(
'label' => __('Enable / Disable ?', 'abiz') ,
'section' => 'footer_section',
)));
// Footer Top Info
$wp_customize->add_setting('footer_top_info', array(
'sanitize_callback' => 'abiz_repeater_sanitize',
'transport' => $selective_refresh,
'priority' => 8,
'default' => abiz_get_default_option( 'footer_top_info' ),
));
$wp_customize->add_control(new Abiz_Repeater($wp_customize, 'footer_top_info', array(
'label' => esc_html__('Contact', 'abiz') ,
'section' => 'footer_section',
'add_field_label' => esc_html__('Add New Contact', 'abiz') ,
'item_name' => esc_html__('Contact', 'abiz') ,
'customizer_repeater_icon_control' => true,
'customizer_repeater_title_control' => true,
'customizer_repeater_subtitle_control' => true,
'customizer_repeater_link_control' => true,
)));
// Upgrade
if (class_exists('Daddy_Plus_Customize_Upgrade_Control'))
{
$wp_customize->add_setting('abiz_footer_top_info_upgrade',array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'priority' => 8
));
$wp_customize->add_control(new Daddy_Plus_Customize_Upgrade_Control($wp_customize,
'abiz_footer_top_info_upgrade',
array(
'label' => __( 'Info', 'abiz' ),
'section' => 'footer_section'
)
)
);
}
/*=========================================
Footer Copyright
=========================================*/
// Head
$wp_customize->add_setting('footer_copy_settings', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
'priority' => 12,
));
$wp_customize->add_control('footer_copy_settings', array(
'type' => 'hidden',
'label' => __('Footer Copyright', 'abiz') ,
'section' => 'footer_section',
));
// Footer Copyright
$wp_customize->add_setting('footer_copyright', array(
'default' => abiz_get_default_option( 'footer_copyright' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'wp_kses_post',
'priority' => 16,
));
$wp_customize->add_control('footer_copyright', array(
'label' => __('Copyright', 'abiz') ,
'section' => 'footer_section',
'type' => 'textarea',
'transport' => $selective_refresh,
));
/*=========================================
Abiz Typography
=========================================*/
// Head
$wp_customize->add_setting('abiz_body_font_family_settings', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text'
));
$wp_customize->add_control('abiz_body_font_family_settings', array(
'type' => 'hidden',
'label' => __('Body Typography Setting', 'abiz') ,
'section' => 'abiz_typography',
'priority' => 1,
));
// Body Font Size //
$wp_customize->add_setting('abiz_body_font_size', array(
'default' => abiz_get_default_option( 'abiz_body_font_size' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_html',
'transport' => 'postMessage',
));
$wp_customize->add_control('abiz_body_font_size', array(
'label' => __('Font Size', 'abiz') ,
'section' => 'abiz_typography',
'type' => 'number',
'priority' => 1,
));
// Body Font weight //
$wp_customize->add_setting('abiz_body_font_weight', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'abiz_sanitize_select',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'abiz_body_font_weight', array(
'label' => __('Weight', 'abiz') ,
'section' => 'abiz_typography',
'type' => 'select',
'priority' => 5,
'choices' => array(
'inherit' => __('Default', 'abiz') ,
'100' => __('Thin: 100', 'abiz') ,
'200' => __('Light: 200', 'abiz') ,
'300' => __('Book: 300', 'abiz') ,
'400' => __('Normal: 400', 'abiz') ,
'500' => __('Medium: 500', 'abiz') ,
'600' => __('Semibold: 600', 'abiz') ,
'700' => __('Bold: 700', 'abiz') ,
'800' => __('Extra Bold: 800', 'abiz') ,
'900' => __('Black: 900', 'abiz') ,
) ,
)));
// Body Font style //
$wp_customize->add_setting('abiz_body_font_style', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'abiz_sanitize_select',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'abiz_body_font_style', array(
'label' => __('Font Style', 'abiz') ,
'section' => 'abiz_typography',
'type' => 'select',
'priority' => 6,
'choices' => array(
'inherit' => __('Inherit', 'abiz') ,
'normal' => __('Normal', 'abiz') ,
'italic' => __('Italic', 'abiz') ,
'oblique' => __('oblique', 'abiz') ,
) ,
)));
// Body Text Transform //
$wp_customize->add_setting('abiz_body_text_transform', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'abiz_sanitize_select',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'abiz_body_text_transform', array(
'label' => __('Transform', 'abiz') ,
'section' => 'abiz_typography',
'type' => 'select',
'priority' => 7,
'choices' => array(
'inherit' => __('Default', 'abiz') ,
'uppercase' => __('Uppercase', 'abiz') ,
'lowercase' => __('Lowercase', 'abiz') ,
'capitalize' => __('Capitalize', 'abiz') ,
) ,
)));
// Body Text Decoration //
$wp_customize->add_setting('abiz_body_txt_decoration', array(
'capability' => 'edit_theme_options',
'default' => 'inherit',
'transport' => 'postMessage',
'sanitize_callback' => 'abiz_sanitize_select',
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'abiz_body_txt_decoration', array(
'label' => __('Text Decoration', 'abiz') ,
'section' => 'abiz_typography',
'type' => 'select',
'priority' => 8,
'choices' => array(
'inherit' => __('Inherit', 'abiz') ,
'underline' => __('Underline', 'abiz') ,
'overline' => __('Overline', 'abiz') ,
'line-through' => __('Line Through', 'abiz') ,
'none' => __('None', 'abiz') ,
) ,
)));
}
add_action('customize_register', 'abiz_general_customize');

View File

@@ -0,0 +1,71 @@
<?php
/**
* Register customizer panels and sections.
*
* @package Abiz
*/
function abiz_panel_section_register( $wp_customize ) {
// Section: Upgrade
$wp_customize->add_section('abiz_upgrade_premium',array(
'priority' => 1,
'title' => __('Upgrade to Pro','abiz'),
));
// Section: Top Bar
$wp_customize->add_section('top_header',array(
'priority' => 1,
'title' => __('Top Bar Setting','abiz'),
'panel' => 'abiz_general',
));
// Section: Menu Bar
$wp_customize->add_section('header_nav',array(
'priority' => 1,
'title' => __('Menu Bar Setting','abiz'),
'panel' => 'abiz_general',
));
// Panel: General
$wp_customize->add_panel('abiz_general', array(
'priority' => 31,
'title' => esc_html__( 'General Options', 'abiz' ),
));
// Section: Page Header
$wp_customize->add_section('header_image', array(
'title' => esc_html__( 'Page Header Setting', 'abiz' ),
'priority' => 1,
'panel' => 'abiz_general',
));
// Section: Top Scroller
$wp_customize->add_section('top_scroller', array(
'title' => esc_html__( 'Top Scroller Setting', 'abiz' ),
'priority' => 4,
'panel' => 'abiz_general',
));
// Section: Blog
$wp_customize->add_section( 'blog_general',array(
'priority' => 34,
'capability' => 'edit_theme_options',
'title' => __('Blog Setting', 'abiz'),
'panel' => 'abiz_general',
));
// Section: Footer
$wp_customize->add_section('footer_section',array(
'priority' => 34,
'capability' => 'edit_theme_options',
'title' => __('Footer Setting', 'abiz'),
'panel' => 'abiz_general',
));
// Section: Typography
$wp_customize->add_section('abiz_typography',array(
'priority' => 1,
'title' => __('Body Typography Setting','abiz'),
'panel' => 'abiz_general',
));
}
add_action( 'customize_register', 'abiz_panel_section_register' );

View File

@@ -0,0 +1,70 @@
<?php
function abiz_selective_refresh( $wp_customize ) {
// hdr_info1_title
$wp_customize->selective_refresh->add_partial( 'hdr_info1_title', array(
'selector' => '.above-header .info1 h6',
'settings' => 'hdr_info1_title',
'render_callback' => 'abiz_hdr_info1_title_render_callback',
) );
// hdr_info2_title
$wp_customize->selective_refresh->add_partial( 'hdr_info2_title', array(
'selector' => '.main-header .info2 h6',
'settings' => 'hdr_info2_title',
'render_callback' => 'abiz_hdr_info2_title_render_callback',
) );
// hdr_info3_title
$wp_customize->selective_refresh->add_partial( 'hdr_info3_title', array(
'selector' => '.main-header .info3 h6',
'settings' => 'hdr_info3_title',
'render_callback' => 'abiz_hdr_info3_title_render_callback',
) );
// hdr_btn_label
$wp_customize->selective_refresh->add_partial( 'hdr_btn_label', array(
'selector' => '.main-navigation .button-area a',
'settings' => 'hdr_btn_label',
'render_callback' => 'abiz_hdr_btn_label_render_callback',
) );
// footer_top_info
$wp_customize->selective_refresh->add_partial( 'footer_top_info', array(
'selector' => '.footer-top .row'
) );
// footer_copyright
$wp_customize->selective_refresh->add_partial( 'footer_copyright', array(
'selector' => '.footer-copyright .copyright-text',
'settings' => 'footer_copyright',
'render_callback' => 'abiz_footer_copyright_render_callback',
) );
}
add_action( 'customize_register', 'abiz_selective_refresh' );
// hdr_info1_title
function abiz_hdr_info1_title_render_callback() {
return get_theme_mod( 'hdr_info1_title' );
}
// hdr_info2_title
function abiz_hdr_info2_title_render_callback() {
return get_theme_mod( 'hdr_info2_title' );
}
// hdr_info3_title
function abiz_hdr_info3_title_render_callback() {
return get_theme_mod( 'hdr_info3_title' );
}
// hdr_btn_label
function abiz_hdr_btn_label_render_callback() {
return get_theme_mod( 'hdr_btn_label' );
}
// footer_copyright
function abiz_footer_copyright_render_callback() {
return get_theme_mod( 'footer_copyright' );
}

View File

@@ -0,0 +1,42 @@
.abiz-getting-started-notice {
padding: 20px 10px;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
-ms-align-items: center;
align-items: center;
}
.abiz-theme-screenshot img {
width: 100%;
max-width: 200px;
display: inline-block;
vertical-align: top;
border: 2px solid #ddd;
border-radius: 4px;
}
.abiz-theme-notice-content {
width: 70%;
display: block;
vertical-align: top;
padding: 0 20px;
}
h2.abiz-notice-h2 {
margin: 0 0 10px;
font-weight: 400;
line-height: 1.3;
}
.abiz-push-down {
padding-top: 15px;
display: inline-block;
padding-left: 8px;
}
.abiz-button-padding.updating-message::before {
margin-top: 12px;
}

View File

@@ -0,0 +1,209 @@
.customize-control-abiz-sortable ul.ui-sortable li {
padding: 5px 10px;
border: 1px solid #333;
background: #fff;
}
.customize-control-abiz-sortable ul.ui-sortable li .dashicons.dashicons-menu {
float: right;
}
.customize-control-abiz-sortable ul.ui-sortable li .dashicons.visibility {
margin-right: 10px;
}
.customize-control-abiz-sortable ul.ui-sortable li.invisible {
color: #aaa;
border: 1px dashed #aaa;
}
.customize-control-abiz-sortable ul.ui-sortable li.invisible .dashicons.visibility {
color: #aaa;
}
.customize-control-hidden {
display: block;
padding: 13px 12px;
color:#fff;
font-weight: 600;
letter-spacing: 1px;
line-height: 1;
margin: 0 -12px;
margin-bottom: 12px;
border-width: 1px 0;
border-style: solid;
border-color: #dddddd;
background-color: #13a1dc;
}
.customize-control-hidden label {
margin-bottom: 0;
line-height: 1;
font-size: 15px;
cursor: default;
}
/* Control: Switch. */
.customize-control-abiz-toggle {
position: relative;
}
.customize-control-abiz-toggle label {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.customize-control-abiz-toggle label .customize-control-title {
width: calc(100% - 55px);
}
.customize-control-abiz-toggle label .description {
-webkit-box-ordinal-group: 100;
-ms-flex-order: 99;
order: 99;
}
.customize-control-abiz-toggle .switch {
border: 1px solid #b4b9be;
display: inline-block;
width: 35px;
height: 12px;
border-radius: 8px;
background: #b4b9be;
vertical-align: middle;
position: relative;
top: 4px;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-transition: background 350ms ease;
transition: background 350ms ease;
}
.customize-control-abiz-toggle .switch::after {
content: "";
display: block;
width: 20px;
height: 20px;
border-radius: 50%;
position: absolute;
top: 50%;
left: -3px;
-webkit-transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
background: #999;
border: 1px solid rgba(0, 0, 0, 0.1);
-webkit-transform: translate3d(0, -50%, 0);
transform: translate3d(0, -50%, 0);
}
.customize-control-abiz-toggle .switch::before {
content: "";
display: block;
width: 20px;
height: 20px;
border-radius: 50%;
position: absolute;
top: 50%;
left: -3px;
-webkit-transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
background: rgba(0, 0, 0, 0.2);
-webkit-transform: translate3d(0, -50%, 0) scale(0);
transform: translate3d(0, -50%, 0) scale(0);
}
.customize-control-abiz-toggle .switch:active::before {
-webkit-transform: translate3d(0, -50%, 0) scale(3);
transform: translate3d(0, -50%, 0) scale(3);
}
.customize-control-abiz-toggle input:checked + .switch::before {
background: rgba(0, 115, 170, 0.075);
-webkit-transform: translate3d(100%, -50%, 0) scale(1);
transform: translate3d(100%, -50%, 0) scale(1);
}
.customize-control-abiz-toggle input:checked + .switch::after {
background: #13a1dc;
-webkit-transform: translate3d(100%, -50%, 0);
transform: translate3d(100%, -50%, 0);
}
.customize-control-abiz-toggle input:checked + .switch:active::before {
background: rgba(0, 115, 170, 0.075);
-webkit-transform: translate3d(100%, -50%, 0) scale(3);
transform: translate3d(100%, -50%, 0) scale(3);
}
.customize-control-abiz-toggle input[type=checkbox] {
display: none;
}
/* Upsale */
.premium-info ul {
margin: 0;
padding: 0;
}
.premium-info ul li {
margin-bottom: 10px;
}
.premium-info ul li a, .up-to-pro {
font-family: 'Noto Sans', sans-serif;
font-weight: bold;
padding: 12px 10px;
display: block;
text-decoration: none;
color: #ffffff;
border-radius: 3px;
font-size: 14px;
letter-spacing: 1px;
overflow: hidden;
-webkit-transition: .3s;
transition: .3s;
background: #009efa; /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #233fe7, #009efa); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #233fe7, #009efa);/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
z-index: 2;
}
.premium-info ul li a:hover, .premium-info ul li a:focus,
.up-to-pro:hover, .up-to-pro:focus {
transform: translateY(-3px);
color: #fff;
box-shadow: 0 0.5rem 1.875rem rgba(0, 0, 0, 0.15);
}
.up-to-pro {
padding: 9px 58px;
text-transform: capitalize;
}
.premium-info ul li a i{
font-size: 15px;
margin-top: 1px;
margin-right: 7px;
}
.premium-info .upgrade-to-pro, .up-to-pro{
background: #ff5d00;
}
li#accordion-section-abiz_upgrade_premium .accordion-section-title:after {
content: "\f174" !important;
color: #ffffff !important;
}
li#accordion-section-abiz_upgrade_premium .accordion-section-title,
li#accordion-section-abiz_upgrade_premium .accordion-section-title:hover,
li#accordion-section-abiz_upgrade_premium .accordion-section-title button:hover,
li#accordion-section-abiz_upgrade_premium .accordion-section-title button:focus {
color: #ffffff !important;
border-left: none;
background: #009efa; /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #233fe7, #009efa) !important; /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #233fe7, #009efa) !important;/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}

View File

@@ -0,0 +1,26 @@
( function( $ ){
$( document ).ready( function(){
$( '.abiz-btn-get-started' ).on( 'click', function( e ) {
e.preventDefault();
$( this ).html( 'Processing.. Please wait' ).addClass( 'updating-message' );
$.post( abiz_ajax_object.ajax_url, { 'action' : 'install_act_plugin' }, function( response ){
location.href = 'customize.php';
} );
} );
} );
$( document ).on( 'click', '.notice-get-started-class .notice-dismiss', function () {
// Read the "data-notice" information to track which notice
// is being dismissed and send it via AJAX
var type = $( this ).closest( '.notice-get-started-class' ).data( 'notice' );
// Make an AJAX call
$.ajax( ajaxurl,
{
type: 'POST',
data: {
action: 'abiz_dismissed_notice_handler',
type: type,
}
} );
} );
}( jQuery ) )

View File

@@ -0,0 +1,86 @@
/**
* sortable
*/
wp.customize.controlConstructor['abiz-sortable'] = wp.customize.Control.extend({
ready: function() {
'use strict';
var control = this;
// Set the sortable container.
control.sortableContainer = control.container.find( 'ul.sortable' ).first();
// Init sortable.
control.sortableContainer.sortable({
// Update value when we stop sorting.
stop: function() {
control.updateValue();
}
}).disableSelection().find( 'li' ).each( function() {
// Enable/disable options when we click on the eye of Thundera.
jQuery( this ).find( 'i.visibility' ).click( function() {
jQuery( this ).toggleClass( 'dashicons-visibility-faint' ).parents( 'li:eq(0)' ).toggleClass( 'invisible' );
});
}).click( function() {
// Update value on click.
control.updateValue();
});
},
/**
* Updates the sorting list
*/
updateValue: function() {
'use strict';
var control = this,
newValue = [];
this.sortableContainer.find( 'li' ).each( function() {
if ( ! jQuery( this ).is( '.invisible' ) ) {
newValue.push( jQuery( this ).data( 'value' ) );
}
});
control.setting.set( newValue );
}
});
/**
* Control: Toggle.
*/
wp.customize.controlConstructor['abiz-toggle'] = wp.customize.Control.extend( {
// When we're finished loading continue processing
ready: function () {
'use strict';
var control = this;
// Init the control.
if (
!_.isUndefined( window.abizControlLoader ) &&
_.isFunction( abizControlLoader )
) {
abizControlLoader( control );
} else {
control.initAbizControl();
}
},
initAbizControl: function () {
var control = this,
checkboxValue = control.setting._value;
// Save the value
this.container.on( 'change', 'input', function () {
checkboxValue = jQuery( this ).is( ':checked' ) ? true : false;
control.setting.set( checkboxValue );
} );
}
} );

View File

@@ -0,0 +1,38 @@
function abizshomesettingsscroll(section_id) {
var scroll_section_id = "slider-section";
var $contents = jQuery('#customize-preview iframe').contents();
switch (section_id) {
case 'accordion-section-info_section_set':
scroll_section_id = "info-section";
break;
case 'accordion-section-service_section_set':
scroll_section_id = "service-section";
break;
case 'accordion-section-marquee_section_set':
scroll_section_id = "abiz-marquee-section";
break;
case 'accordion-section-features2_section_set':
scroll_section_id = "abiz-features-section-2";
break;
case 'accordion-section-blog_section_set':
scroll_section_id = "abiz-blog-section";
break;
}
if ($contents.find('#' + scroll_section_id).length > 0) {
$contents.find("html, body").animate({
scrollTop: $contents.find("#" + scroll_section_id).offset().top
}, 1000);
}
}
jQuery('body').on('click', '#sub-accordion-panel-abiz_frontpage_sections .control-subsection .accordion-section-title', function(event) {
var section_id = jQuery(this).parent('.control-subsection').attr('id');
abizshomesettingsscroll(section_id);
});

View File

@@ -0,0 +1,259 @@
/**
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
(function($) {
// Site title and description.
wp.customize('blogname', function(value) {
value.bind(function(to) {
$('.site-title').text(to);
});
});
wp.customize('blogdescription', function(value) {
value.bind(function(to) {
$('.site-description').text(to);
});
});
// Header text color.
wp.customize('header_textcolor', function(value) {
value.bind(function(to) {
if ('blank' === to) {
$('.site-title, .site-description').css({
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
});
} else {
$('.site-title, .site-description').css({
'clip': 'auto',
'position': 'relative'
});
$('.site-title, .site-description').css({
'color': to
});
}
});
});
$(document).ready(function($) {
$('input[data-input-type]').on('input change', function() {
var val = $(this).val();
$(this).prev('.cs-range-value').html(val);
$(this).val(val);
});
})
// logo_size
wp.customize('logo_size', function(value) {
value.bind(function(logo_size) {
jQuery('.logo img, .mobile-logo img').css('max-width', logo_size + 'px');
});
});
// site_ttl_font_size
wp.customize('site_ttl_font_size', function(value) {
value.bind(function(site_ttl_font_size) {
jQuery('h4.site-title').css('font-size', site_ttl_font_size + 'px');
});
});
// site_desc_font_size
wp.customize('site_desc_font_size', function(value) {
value.bind(function(site_desc_font_size) {
jQuery('.site-description').css('font-size', site_desc_font_size + 'px');
});
});
//hdr_info1_title
wp.customize(
'hdr_info1_title',
function(value) {
value.bind(
function(newval) {
$('.above-header .info1 h6').text(newval);
}
);
}
);
//hdr_info2_title
wp.customize(
'hdr_info2_title',
function(value) {
value.bind(
function(newval) {
$('.main-header .info2 h6').text(newval);
}
);
}
);
//hdr_info3_title
wp.customize(
'hdr_info3_title',
function(value) {
value.bind(
function(newval) {
$('.main-header .info3 h6').text(newval);
}
);
}
);
//hdr_btn_label
wp.customize(
'hdr_btn_label',
function(value) {
value.bind(
function(newval) {
$('.main-navigation .button-area a').text(newval);
}
);
}
);
//service_ttl
wp.customize(
'service_ttl',
function(value) {
value.bind(
function(newval) {
$('.abiz-service-main .theme-main-heading .title').text(newval);
}
);
}
);
//service_subttl
wp.customize(
'service_subttl',
function(value) {
value.bind(
function(newval) {
$('.abiz-service-main .theme-main-heading h2').text(newval);
}
);
}
);
//service_desc
wp.customize(
'service_desc',
function(value) {
value.bind(
function(newval) {
$('.abiz-service-main .theme-main-heading p').text(newval);
}
);
}
);
//features2_ttl
wp.customize(
'features2_ttl',
function(value) {
value.bind(
function(newval) {
$('.abiz-features-section-2 .theme-main-heading .title').text(newval);
}
);
}
);
//features2_subttl
wp.customize(
'features2_subttl',
function(value) {
value.bind(
function(newval) {
$('.abiz-features-section-2 .theme-main-heading h2').text(newval);
}
);
}
);
//features2_desc
wp.customize(
'features2_desc',
function(value) {
value.bind(
function(newval) {
$('.abiz-features-section-2 .theme-main-heading p').text(newval);
}
);
}
);
//blog_ttl
wp.customize(
'blog_ttl',
function(value) {
value.bind(
function(newval) {
$('.abiz-blog-main .theme-main-heading .title').text(newval);
}
);
}
);
//blog_subttl
wp.customize(
'blog_subttl',
function(value) {
value.bind(
function(newval) {
$('.abiz-blog-main .theme-main-heading h2').text(newval);
}
);
}
);
//blog_desc
wp.customize(
'blog_desc',
function(value) {
value.bind(
function(newval) {
$('.abiz-blog-main .theme-main-heading p').text(newval);
}
);
}
);
// font size
wp.customize('abiz_body_font_size', function(value) {
value.bind(function(abiz_body_font_size) {
jQuery('body').css('font-size', abiz_body_font_size + 'px');
});
});
// font weight
wp.customize('abiz_body_font_weight', function(value) {
value.bind(function(font_weight) {
jQuery('body').css('font-weight', font_weight);
});
});
// font style
wp.customize('abiz_body_font_style', function(value) {
value.bind(function(font_style) {
jQuery('body').css('font-style', font_style);
});
});
// Text Decoration
wp.customize('abiz_body_txt_decoration', function(value) {
value.bind(function(decoration) {
jQuery('body, a').css('text-decoration', decoration);
});
});
// text tranform
wp.customize('abiz_body_text_transform', function(value) {
value.bind(function(text_tranform) {
jQuery('body').css('text-transform', text_tranform);
});
});
})(jQuery);

View File

@@ -0,0 +1,95 @@
<?php
/**
* Customize Base control class.
*
* @package Abiz
*
* @see WP_Customize_Control
* @access public
*/
/**
* Class Abiz_Customize_Base_Control
*/
class Abiz_Customize_Base_Control extends WP_Customize_Control {
/**
* Enqueue scripts all controls.
*/
public function enqueue() {
// Main scripts.
wp_enqueue_script(
'abiz-controls',
ABIZ_THEME_CORE_URI . '/customizer/assets/js/controls.js',
array(
'jquery',
'customize-base',
'jquery-ui-button',
'jquery-ui-sortable',
),
false,
true
);
wp_enqueue_style( 'abiz-controls', ABIZ_THEME_CORE_URI . '/customizer/assets/css/controls.css' );
wp_enqueue_style( 'all-css', ABIZ_THEME_URI . '/assets/css/all.min.css' );
}
/**
* Refresh the parameters passed to the JavaScript via JSON.
*
* @see WP_Customize_Control::to_json()
* @access public
* @return void
*/
public function to_json() {
parent::to_json();
$this->json['default'] = $this->setting->default;
if ( isset( $this->default ) ) {
$this->json['default'] = $this->default;
}
$this->json['id'] = $this->id;
$this->json['link'] = $this->get_link();
$this->json['value'] = maybe_unserialize( $this->value() );
$this->json['choices'] = $this->choices;
$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() );
}
/**
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
*/
protected function render_content() {
}
/**
* Renders the Underscore template for this control.
*
* @see WP_Customize_Control::print_template()
* @access protected
* @return void
*/
protected function content_template() {
}
/**
* Returns an array of translation strings.
*
* @access protected
* @return array
*/
protected function l10n() {
return array();
}
}

View File

@@ -0,0 +1,42 @@
<?php
if ( ! class_exists( 'WP_Customize_Control' ) )
return NULL;
class Abiz_Category_Dropdown_Custom_Control extends WP_Customize_Control
{
private $cats = false;
public function __construct($manager, $id, $args = array(), $options = array())
{
$this->cats = get_categories($options);
parent::__construct( $manager, $id, $args );
}
/**
* Render the content of the category dropdown
*
* @return HTML
*/
public function render_content()
{
if(!empty($this->cats))
{
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<select <?php $this->link(); ?>>
<?php
foreach ( $this->cats as $cat )
{
printf('<option value="%s">%s</option>', $cat->term_id, $cat->name);
}
?>
</select>
</label>
<?php
}
}
}
?>

View File

@@ -0,0 +1,98 @@
<?php
/**
* Customizer Control: sortable
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Sortable control (uses checkboxes).
*/
class Abiz_Control_Sortable extends Abiz_Customize_Base_Control {
/**
* The control type.
*
* @access public
* @var string
*/
public $type = 'abiz-sortable';
/**
* Refresh the parameters passed to the JavaScript via JSON.
*
* @see WP_Customize_Control::to_json()
*/
public function to_json() {
parent::to_json();
$this->json['default'] = $this->setting->default;
if ( isset( $this->default ) ) {
$this->json['default'] = $this->default;
}
$this->json['id'] = $this->id;
$this->json['link'] = $this->get_link();
$this->json['value'] = maybe_unserialize( $this->value() );
$this->json['choices'] = $this->choices;
$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() );
}
/**
* An Underscore (JS) template for this control's content (but not its container).
*
* Class variables for this control class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Control::to_json()}.
*
* @see WP_Customize_Control::print_template()
*
* @access protected
*/
protected function content_template() {
?>
<label class='abiz-sortable'>
<span class="customize-control-title">
{{{ data.label }}}
</span>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<ul class="sortable">
<# _.each( data.value, function( choiceID ) { #>
<li {{{ data.inputAttrs }}} class='abiz-sortable-item' data-value='{{ choiceID }}'>
<i class='dashicons dashicons-menu'></i>
<i class="dashicons dashicons-visibility visibility"></i>
{{{ data.choices[ choiceID ] }}}
</li>
<# }); #>
<# _.each( data.choices, function( choiceLabel, choiceID ) { #>
<# if ( -1 === data.value.indexOf( choiceID ) ) { #>
<li {{{ data.inputAttrs }}} class='abiz-sortable-item invisible' data-value='{{ choiceID }}'>
<i class='dashicons dashicons-menu'></i>
<i class="dashicons dashicons-visibility visibility"></i>
{{{ data.choices[ choiceID ] }}}
</li>
<# } #>
<# }); #>
</ul>
</label>
<?php
}
/**
* Render the control's content.
*
* @see WP_Customize_Control::render_content()
*/
protected function render_content() {}
}

View File

@@ -0,0 +1,56 @@
<?php
/**
* Customize Toggle control class.
*
* @package abiz
*
* @see WP_Customize_Control
* @access public
*/
/**
* Class Abiz_Customize_Toggle_Control
*/
class Abiz_Customize_Toggle_Control extends Abiz_Customize_Base_Control {
/**
* Customize control type.
*
* @access public
* @var string
*/
public $type = 'abiz-toggle';
/**
* Renders the Underscore template for this control.
*
* @see WP_Customize_Control::print_template()
* @access protected
* @return void
*/
protected function content_template() {
?>
<label for="toggle_{{ data.id }}">
<span class="customize-control-title">
{{{ data.label }}}
</span>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<input class="screen-reader-text" {{{ data.inputAttrs }}} name="toggle_{{ data.id }}"
id="toggle_{{ data.id }}" type="checkbox" value="{{ data.value }}" {{{ data.link }}}<# if ( true === data.value ) { #> checked<# } #> hidden />
<span class="switch"></span>
</label>
<?php
}
/**
* Render content is still called, so be sure to override it with an empty function in your subclass as well.
*/
protected function render_content() {
}
}

View File

@@ -0,0 +1,42 @@
<?php
/*
* Upgrade to pro options
*/
function abiz_upgrade_pro_options( $wp_customize ) {
class Abiz_WP_Button_Customize_Control extends WP_Customize_Control {
public $type = 'abiz_upgrade_premium';
function render_content() {
?>
<div class="premium-info">
<ul>
<!--li><a class="documentation" href="#" target="_blank"><i class="dashicons dashicons-visibility"></i><?php //_e( 'View Documentation','abiz' ); ?> </a></li-->
<li><a class="support" href="https://themesdaddy.com/support/" target="_blank"><i class="dashicons dashicons-lightbulb"></i><?php _e( 'Need Support ?','abiz' ); ?> </a></li>
<li><a class="free-pro" href="https://demo.themesdaddy.com/abiz-pro/" target="_blank"><i class="dashicons dashicons-visibility"></i><?php _e( 'Premium Demo','abiz' ); ?> </a></li>
<li><a class="upgrade-to-pro" href="https://themesdaddy.com/themes/abiz-pro/" target="_blank"><i class="dashicons dashicons-update-alt"></i><?php _e( 'Upgrade to Pro','abiz' ); ?> </a></li>
<li><a class="show-love" href="https://wordpress.org/support/theme/abiz/reviews/#new-post" target="_blank"><i class="dashicons dashicons-smiley"></i><?php _e( 'Share a Good Review','abiz' ); ?> </a></li>
</ul>
</div>
<?php
}
}
$wp_customize->add_setting(
'premium_info_buttons',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'abiz_sanitize_text',
)
);
$wp_customize->add_control( new Abiz_WP_Button_Customize_Control( $wp_customize, 'premium_info_buttons', array(
'section' => 'abiz_upgrade_premium',
))
);
}
add_action( 'customize_register', 'abiz_upgrade_pro_options' );

View File

@@ -0,0 +1,298 @@
<?php
class abiz_Customizer_Notify_Section extends WP_Customize_Section {
public $type = 'abiz-customizer-notify-section';
public $recommended_actions = '';
public $recommended_plugins = '';
public $total_actions = '';
public $plugin_text = '';
public $dismiss_button = '';
public function check_active( $slug ) {
if ( file_exists( ABSPATH . 'wp-content/plugins/' . $slug . '/' . $slug . '.php' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$needs = is_plugin_active( $slug . '/' . $slug . '.php' ) ? 'deactivate' : 'activate';
return array(
'status' => is_plugin_active( $slug . '/' . $slug . '.php' ),
'needs' => $needs,
);
}
return array(
'status' => false,
'needs' => 'install',
);
}
public function create_action_link( $state, $slug ) {
switch ( $state ) {
case 'install':
return wp_nonce_url(
add_query_arg(
array(
'action' => 'install-plugin',
'plugin' => $slug,
),
network_admin_url( 'update.php' )
),
'install-plugin_' . $slug
);
break;
case 'deactivate':
return add_query_arg(
array(
'action' => 'deactivate',
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
'plugin_status' => 'all',
'paged' => '1',
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug . '.php' ),
), network_admin_url( 'plugins.php' )
);
break;
case 'activate':
return add_query_arg(
array(
'action' => 'activate',
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
'plugin_status' => 'all',
'paged' => '1',
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug . '.php' ),
), network_admin_url( 'plugins.php' )
);
break;
}// End switch().
}
public function call_plugin_api( $slug ) {
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
$call_api = get_transient( 'abiz_cust_notify_plugin_info_' . $slug );
if ( false === $call_api ) {
$call_api = plugins_api(
'plugin_information', array(
'slug' => $slug,
'fields' => array(
'downloaded' => false,
'rating' => false,
'description' => false,
'short_description' => true,
'donate_link' => false,
'tags' => false,
'sections' => false,
'homepage' => false,
'added' => false,
'last_updated' => false,
'compatibility' => false,
'tested' => false,
'requires' => false,
'downloadlink' => false,
'icons' => false,
),
)
);
set_transient( 'abiz_cust_notify_plugin_info_' . $slug, $call_api, 30 * MINUTE_IN_SECONDS );
}
return $call_api;
}
public function json() {
$json = parent::json();
global $abiz_customizer_notify_recommended_actions;
global $abiz_customizer_notify_recommended_plugins;
global $install_button_label;
global $activate_button_label;
global $abiz_deactivate_button_label;
$formatted_array = array();
$abiz_customizer_notify_show_recommended_actions = get_option( 'abiz_customizer_notify_show' );
foreach ( $abiz_customizer_notify_recommended_actions as $key => $abiz_lite_customizer_notify_recommended_action ) {
if ( $abiz_customizer_notify_show_recommended_actions[ $abiz_lite_customizer_notify_recommended_action['id'] ] === false ) {
continue;
}
if ( $abiz_lite_customizer_notify_recommended_action['check'] ) {
continue;
}
$abiz_lite_customizer_notify_recommended_action['index'] = $key + 1;
if ( isset( $abiz_lite_customizer_notify_recommended_action['plugin_slug'] ) ) {
$active = $this->check_active( $abiz_customizer_notify_recommended_action['plugin_slug'] );
$abiz_lite_customizer_notify_recommended_action['url'] = $this->create_action_link( $active['needs'], $abiz_lite_customizer_notify_recommended_action['plugin_slug'] );
if ( $active['needs'] !== 'install' && $active['status'] ) {
$abiz_lite_customizer_notify_recommended_action['class'] = 'active';
} else {
$abiz_lite_customizer_notify_recommended_action['class'] = '';
}
switch ( $active['needs'] ) {
case 'install':
$abiz_lite_customizer_notify_recommended_action['button_class'] = 'install-now button';
$abiz_lite_customizer_notify_recommended_action['button_label'] = $install_button_label;
break;
case 'activate':
$abiz_lite_customizer_notify_recommended_action['button_class'] = 'activate-now button button-primary';
$abiz_lite_customizer_notify_recommended_action['button_label'] = $activate_button_label;
break;
case 'deactivate':
$abiz_lite_customizer_notify_recommended_action['button_class'] = 'deactivate-now button';
$abiz_lite_customizer_notify_recommended_action['button_label'] = $abiz_deactivate_button_label;
break;
}
}
$formatted_array[] = $abiz_lite_customizer_notify_recommended_action;
}// End foreach().
$customize_plugins = array();
$abiz_lite_customizer_notify_show_recommended_plugins = get_option( 'abiz_customizer_notify_show_recommended_plugins' );
foreach ( $abiz_customizer_notify_recommended_plugins as $slug => $abiz_plugin_opt ) {
if ( ! $abiz_plugin_opt['recommended'] ) {
continue;
}
if ( isset( $abiz_lite_customizer_notify_show_recommended_plugins[ $slug ] ) && $abiz_lite_customizer_notify_show_recommended_plugins[ $slug ] ) {
continue;
}
$active = $this->check_active( $slug );
if ( ! empty( $active['needs'] ) && ( $active['needs'] == 'deactivate' ) ) {
continue;
}
$ti_customizer_notify_recommended_plugin['url'] = $this->create_action_link( $active['needs'], $slug );
if ( $active['needs'] !== 'install' && $active['status'] ) {
$ti_customizer_notify_recommended_plugin['class'] = 'active';
} else {
$ti_customizer_notify_recommended_plugin['class'] = '';
}
switch ( $active['needs'] ) {
case 'install':
$ti_customizer_notify_recommended_plugin['button_class'] = 'install-now button';
$ti_customizer_notify_recommended_plugin['button_label'] = $install_button_label;
break;
case 'activate':
$ti_customizer_notify_recommended_plugin['button_class'] = 'activate-now button button-primary';
$ti_customizer_notify_recommended_plugin['button_label'] = $activate_button_label;
break;
case 'deactivate':
$ti_customizer_notify_recommended_plugin['button_class'] = 'deactivate-now button';
$ti_customizer_notify_recommended_plugin['button_label'] = $abiz_deactivate_button_label;
break;
}
$abiz_info = $this->call_plugin_api( $slug );
$ti_customizer_notify_recommended_plugin['id'] = $slug;
$ti_customizer_notify_recommended_plugin['plugin_slug'] = $slug;
if ( ! empty( $abiz_plugin_opt['description'] ) ) {
$ti_customizer_notify_recommended_plugin['description'] = $abiz_plugin_opt['description'];
} else {
$ti_customizer_notify_recommended_plugin['description'] = $abiz_info->short_description;
}
$ti_customizer_notify_recommended_plugin['title'] = $abiz_info->name;
$customize_plugins[] = $ti_customizer_notify_recommended_plugin;
}// End foreach().
$json['recommended_actions'] = $formatted_array;
$json['recommended_plugins'] = $customize_plugins;
$json['total_actions'] = count( $abiz_customizer_notify_recommended_actions );
$json['plugin_text'] = $this->plugin_text;
$json['dismiss_button'] = $this->dismiss_button;
return $json;
}
protected function render_template() {
?>
<# if( data.recommended_actions.length > 0 || data.recommended_plugins.length > 0 ){ #>
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
<h3 class="accordion-section-title">
<span class="section-title" data-plugin_text="{{ data.plugin_text }}">
<# if( data.recommended_actions.length > 0 ){ #>
{{ data.title }}
<# }else{ #>
<# if( data.recommended_plugins.length > 0 ){ #>
{{ data.plugin_text }}
<# }#>
<# } #>
</span>
<# if( data.recommended_actions.length > 0 ){ #>
<span class="abiz-customizer-plugin-notify-actions-count">
<span class="current-index">{{ data.recommended_actions[0].index }}</span>
{{ data.total_actions }}
</span>
<# } #>
</h3>
<div class="abiz-theme-recomended-actions_container" id="plugin-filter">
<# if( data.recommended_actions.length > 0 ){ #>
<# for (action in data.recommended_actions) { #>
<div class="abiz-recommeded-actions-container epsilon-required-actions" data-index="{{ data.recommended_actions[action].index }}">
<# if( !data.recommended_actions[action].check ){ #>
<div class="abiz-epsilon-recommeded-actions">
<p class="title">{{ data.recommended_actions[action].title }}</p>
<span data-action="dismiss" class="dashicons dashicons-no abiz-customizer-notify-dismiss-recommended-action" id="{{ data.recommended_actions[action].id }}"></span>
<div class="description">{{{ data.recommended_actions[action].description }}}</div>
<# if( data.recommended_actions[action].plugin_slug ){ #>
<div class="custom-action">
<p class="plugin-card-{{ data.recommended_actions[action].plugin_slug }} action_button {{ data.recommended_actions[action].class }}">
<a data-slug="{{ data.recommended_actions[action].plugin_slug }}" class="{{ data.recommended_actions[action].button_class }}" href="{{ data.recommended_actions[action].url }}">{{ data.recommended_actions[action].button_label }}</a>
</p>
</div>
<# } #>
<# if( data.recommended_actions[action].help ){ #>
<div class="custom-action">{{{ data.recommended_actions[action].help }}}</div>
<# } #>
</div>
<# } #>
</div>
<# } #>
<# } #>
<# if( data.recommended_plugins.length > 0 ){ #>
<# for (action in data.recommended_plugins) { #>
<div class="abiz-recommeded-actions-container epsilon-recommended-plugins" data-index="{{ data.recommended_plugins[action].index }}">
<# if( !data.recommended_plugins[action].check ){ #>
<div class="abiz-epsilon-recommeded-actions">
<p class="title">{{ data.recommended_plugins[action].title }}</p>
<span data-action="dismiss" class="dashicons dashicons-no abiz-customizer-notify-dismiss-button-recommended-plugin" id="{{ data.recommended_plugins[action].id }}"></span>
<div class="description">{{{ data.recommended_plugins[action].description }}}</div>
<# if( data.recommended_plugins[action].plugin_slug ){ #>
<div class="custom-action">
<p class="plugin-card-{{ data.recommended_plugins[action].plugin_slug }} action_button {{ data.recommended_plugins[action].class }}">
<a data-slug="{{ data.recommended_plugins[action].plugin_slug }}" class="{{ data.recommended_plugins[action].button_class }}" href="{{ data.recommended_plugins[action].url }}">{{ data.recommended_plugins[action].button_label }}</a>
</p>
</div>
<# } #>
<# if( data.recommended_plugins[action].help ){ #>
<div class="custom-action">{{{ data.recommended_plugins[action].help }}}</div>
<# } #>
</div>
<# } #>
</div>
<# } #>
<# } #>
</div>
</li>
<# } #>
<?php
}
}

View File

@@ -0,0 +1,206 @@
<?php
class abiz_Customizer_Notify {
private $recommended_actions;
private $recommended_plugins;
private static $instance;
private $recommended_actions_title;
private $recommended_plugins_title;
private $dismiss_button;
private $install_button_label;
private $activate_button_label;
private $abiz_deactivate_button_label;
private $config;
public static function init( $config ) {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof abiz_Customizer_Notify ) ) {
self::$instance = new abiz_Customizer_Notify();
if ( ! empty( $config ) && is_array( $config ) ) {
self::$instance->config = $config;
self::$instance->setup_config();
self::$instance->setup_actions();
}
}
}
public function setup_config() {
global $abiz_customizer_notify_recommended_plugins;
global $abiz_customizer_notify_recommended_actions;
global $install_button_label;
global $activate_button_label;
global $abiz_deactivate_button_label;
$this->recommended_actions = isset( $this->config['recommended_actions'] ) ? $this->config['recommended_actions'] : array();
$this->recommended_plugins = isset( $this->config['recommended_plugins'] ) ? $this->config['recommended_plugins'] : array();
$this->recommended_actions_title = isset( $this->config['recommended_actions_title'] ) ? $this->config['recommended_actions_title'] : '';
$this->recommended_plugins_title = isset( $this->config['recommended_plugins_title'] ) ? $this->config['recommended_plugins_title'] : '';
$this->dismiss_button = isset( $this->config['dismiss_button'] ) ? $this->config['dismiss_button'] : '';
$abiz_customizer_notify_recommended_plugins = array();
$abiz_customizer_notify_recommended_actions = array();
if ( isset( $this->recommended_plugins ) ) {
$abiz_customizer_notify_recommended_plugins = $this->recommended_plugins;
}
if ( isset( $this->recommended_actions ) ) {
$abiz_customizer_notify_recommended_actions = $this->recommended_actions;
}
$install_button_label = isset( $this->config['install_button_label'] ) ? $this->config['install_button_label'] : '';
$activate_button_label = isset( $this->config['activate_button_label'] ) ? $this->config['activate_button_label'] : '';
$abiz_deactivate_button_label = isset( $this->config['abiz_deactivate_button_label'] ) ? $this->config['abiz_deactivate_button_label'] : '';
}
public function setup_actions() {
// Register the section.
add_action( 'customize_register', array( $this, 'abiz_plugin_notification_customize_register' ) );
// Enqueue scripts and styles.
add_action( 'customize_controls_enqueue_scripts', array( $this, 'abiz_customizer_notify_scripts_for_customizer' ), 0 );
/* ajax callback for dismissable recommended actions */
add_action( 'wp_ajax_abiz_customizer_notify_dismiss_action', array( $this, 'abiz_customizer_notify_dismiss_recommended_action_callback' ) );
add_action( 'wp_ajax_abiz_customizer_notify_dismiss_recommended_plugins', array( $this, 'abiz_customizer_notify_dismiss_recommended_plugins_callback' ) );
}
public function abiz_customizer_notify_scripts_for_customizer() {
wp_enqueue_style( 'abiz-customizer-notify-css', get_template_directory_uri() . '/core/customizer/customizer-notice/css/abiz-customizer-notify.css', array() );
wp_enqueue_style( 'plugin-install' );
wp_enqueue_script( 'plugin-install' );
wp_add_inline_script( 'plugin-install', 'var pagenow = "customizer";' );
wp_enqueue_script( 'updates' );
wp_enqueue_script( 'abiz-customizer-notify-js', get_template_directory_uri() . '/core/customizer/customizer-notice/js/abiz-customizer-notify.js', array( 'customize-controls' ) );
wp_localize_script(
'abiz-customizer-notify-js',
'abizCustomizercompanionObject',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'template_directory' => get_template_directory_uri(),
'base_path' => admin_url(),
'activating_string' => __( 'Activating', 'abiz' ),
)
);
}
public function abiz_plugin_notification_customize_register( $wp_customize ) {
require_once get_template_directory() . '/core/customizer/customizer-notice/abiz-customizer-notify-section.php';
$wp_customize->register_section_type( 'abiz_Customizer_Notify_Section' );
$wp_customize->add_section(
new abiz_Customizer_Notify_Section(
$wp_customize,
'abiz-customizer-notify-section',
array(
'title' => $this->recommended_actions_title,
'plugin_text' => $this->recommended_plugins_title,
'dismiss_button' => $this->dismiss_button,
'priority' => 0,
)
)
);
}
public function abiz_customizer_notify_dismiss_recommended_action_callback() {
global $abiz_customizer_notify_recommended_actions;
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
echo esc_html($action_id);
if ( ! empty( $action_id ) ) {
if ( get_option( 'abiz_customizer_notify_show' ) ) {
$abiz_customizer_notify_show_recommended_actions = get_option( 'abiz_customizer_notify_show' );
switch ( $_GET['todo'] ) {
case 'add':
$abiz_customizer_notify_show_recommended_actions[ $action_id ] = true;
break;
case 'dismiss':
$abiz_customizer_notify_show_recommended_actions[ $action_id ] = false;
break;
}
update_option( 'abiz_customizer_notify_show', $abiz_customizer_notify_show_recommended_actions );
} else {
$abiz_customizer_notify_show_recommended_actions = array();
if ( ! empty( $abiz_customizer_notify_recommended_actions ) ) {
foreach ( $abiz_customizer_notify_recommended_actions as $abiz_lite_customizer_notify_recommended_action ) {
if ( $abiz_lite_customizer_notify_recommended_action['id'] == $action_id ) {
$abiz_customizer_notify_show_recommended_actions[ $abiz_lite_customizer_notify_recommended_action['id'] ] = false;
} else {
$abiz_customizer_notify_show_recommended_actions[ $abiz_lite_customizer_notify_recommended_action['id'] ] = true;
}
}
update_option( 'abiz_customizer_notify_show', $abiz_customizer_notify_show_recommended_actions );
}
}
}
die();
}
public function abiz_customizer_notify_dismiss_recommended_plugins_callback() {
$action_id = ( isset( $_GET['id'] ) ) ? $_GET['id'] : 0;
echo esc_html($action_id);
if ( ! empty( $action_id ) ) {
$abiz_lite_customizer_notify_show_recommended_plugins = get_option( 'abiz_customizer_notify_show_recommended_plugins' );
switch ( $_GET['todo'] ) {
case 'add':
$abiz_lite_customizer_notify_show_recommended_plugins[ $action_id ] = false;
break;
case 'dismiss':
$abiz_lite_customizer_notify_show_recommended_plugins[ $action_id ] = true;
break;
}
update_option( 'abiz_customizer_notify_show_recommended_plugins', $abiz_lite_customizer_notify_show_recommended_plugins );
}
die();
}
}

View File

@@ -0,0 +1,139 @@
.abiz-customizer-plugin-notify-actions-count {
display: inline-block;
z-index: 26;
margin: 1px 0 0 2px;
padding: 0 6px;
border-radius: 10px;
color: #fff;
background-color: #d54e21;
font-size: 9px;
font-weight: 600;
line-height: 17px;
vertical-align: top;
}
div.abiz-theme-recomended-actions_container {
margin-bottom: 2em;
padding: 0 10px;
}
.abiz-theme-recomended-actions_container p.succes {
margin: 1em 0;
}
.abiz-epsilon-recommeded-actions p.title {
margin-bottom: 0;
color: #555d66;
font-size: 14px;
font-weight: 600;
}
.abiz-epsilon-recommeded-actions div.description {
font-size: 12px;
}
.abiz-epsilon-recommeded-actions .custom-action {
margin-top: 1em;
padding-top: 1em;
border-top: 1px solid #fafafa;
}
.abiz-epsilon-recommeded-actions .custom-action p {
margin-top: 0;
}
.abiz-theme-recomended-actions_container .abiz-recommeded-actions-container:not(:first-child) {
overflow: hidden;
height: 0;
opacity: 0;
}
.abiz-theme-recomended-actions_container .abiz-recommeded-actions-container:first-child {
height: auto;
opacity: 1;
}
.abiz-theme-recomended-actions_container .abiz-recommeded-actions-container {
-webkit-transition: opacity 2s;
/* Safari */
transition: opacity 2s;
}
.abiz-theme-recomended-actions_container .hide {
display: none;
}
.abiz-customizer-plugin-notify-actions-count.complete {
background-color: #79ba49;
}
.abiz-theme-recomended-actions_container #demo_content .button {
display: block;
margin-bottom: 1em;
text-align: center;
}
.abiz-theme-recomended-actions_container .succes a {
display: inline-block;
width: 100%;
text-align: center;
}
.abiz-theme-recomended-actions_container .succes a.social {
width: 49%;
margin-bottom: 1em;
padding-top: 4px;
line-height: 20px;
}
.abiz-theme-recomended-actions_container .succes a.social span,
.abiz-theme-recomended-actions_container .succes span {
margin-right: 5px;
}
.abiz-theme-recomended-actions_container .succes {
padding-top: 4px;
line-height: 20px;
}
.abiz-customizer-notify-dismiss-button-recommended-plugin,
.abiz-customizer-notify-dismiss-recommended-action {
position: absolute;
top: 10px;
right: 10px;
border-radius: 50%;
color: #d54e21;
text-decoration: none;
cursor: pointer;
}
.abiz-epsilon-recommeded-actions {
position: relative;
}
.abiz-customizer-notify-dismiss-recommended-action,
.abiz-epsilon-recommeded-actions .abiz-customizer-notify-dismiss-button-recommended-plugin {
top: 0;
right: 0;
}
.abiz-epsilon-recommeded-actions #temp_load {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-webkit-align-items: center;
align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
}
.abiz-epsilon-recommeded-actions #temp_load img {
margin: 0 auto;
}

View File

@@ -0,0 +1,180 @@
/**
* Customizer notification system
*/
(function (api) {
api.sectionConstructor['abiz-customizer-notify-section'] = api.Section.extend(
{
// No events for this type of section.
attachEvents: function () {
},
// Always make the section active.
isContextuallyActive: function () {
return true;
}
}
);
})( wp.customize );
jQuery( document ).ready(
function () {
jQuery( '.abiz-customizer-notify-dismiss-recommended-action' ).click(
function () {
var id = jQuery( this ).attr( 'id' ),
action = jQuery( this ).attr( 'data-action' );
jQuery.ajax(
{
type: 'GET',
data: {action: 'abiz_customizer_notify_dismiss_action', id: id, todo: action},
dataType: 'html',
url: abizCustomizercompanionObject.ajaxurl,
beforeSend: function () {
jQuery( '#' + id ).parent().append( '<div id="temp_load" style="text-align:center"><img src="' + abizCustomizercompanionObject.base_path + '/images/spinner-2x.gif" /></div>' );
},
success: function (data) {
var container = jQuery( '#' + data ).parent().parent();
var index = container.next().data( 'index' );
var recommended_sction = jQuery( '#accordion-section-ti_customizer_notify_recomended_actions' );
var actions_count = recommended_sction.find( '.abiz-customizer-plugin-notify-actions-count' );
var section_title = recommended_sction.find( '.section-title' );
jQuery( '.abiz-customizer-plugin-notify-actions-count .current-index' ).text( index );
container.slideToggle().remove();
if (jQuery( '.abiz-theme-recomended-actions_container > .epsilon-recommended-actions' ).length === 0) {
actions_count.remove();
if (jQuery( '.abiz-theme-recomended-actions_container > .epsilon-recommended-plugins' ).length === 0) {
jQuery( '.control-section-ti-customizer-notify-recomended-actions' ).remove();
} else {
section_title.text( section_title.data( 'plugin_text' ) );
}
}
},
error: function (jqXHR, textStatus, errorThrown) {
console.log( jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown );
}
}
);
}
);
jQuery( '.abiz-customizer-notify-dismiss-button-recommended-plugin' ).click(
function () {
var id = jQuery( this ).attr( 'id' ),
action = jQuery( this ).attr( 'data-action' );
jQuery.ajax(
{
type: 'GET',
data: {action: 'abiz_customizer_notify_dismiss_recommended_plugins', id: id, todo: action},
dataType: 'html',
url: abizCustomizercompanionObject.ajaxurl,
beforeSend: function () {
jQuery( '#' + id ).parent().append( '<div id="temp_load" style="text-align:center"><img src="' + abizCustomizercompanionObject.base_path + '/images/spinner-2x.gif" /></div>' );
},
success: function (data) {
var container = jQuery( '#' + data ).parent().parent();
var index = container.next().data( 'index' );
jQuery( '.abiz-customizer-plugin-notify-actions-count .current-index' ).text( index );
container.slideToggle().remove();
if (jQuery( '.abiz-theme-recomended-actions_container > .epsilon-recommended-plugins' ).length === 0) {
jQuery( '.control-section-ti-customizer-notify-recomended-section' ).remove();
}
},
error: function (jqXHR, textStatus, errorThrown) {
console.log( jqXHR + ' :: ' + textStatus + ' :: ' + errorThrown );
}
}
);
}
);
// Remove activate button and replace with activation in progress button.
jQuery( document ).on(
'DOMNodeInserted','.activate-now', function () {
var activateButton = jQuery( '.activate-now' );
if (activateButton.length) {
var url = jQuery( activateButton ).attr( 'href' );
if (typeof url !== 'undefined') {
// Request plugin activation.
jQuery.ajax(
{
beforeSend: function () {
jQuery( activateButton ).replaceWith( '<a class="button updating-message">' + abizCustomizercompanionObject.activating_string + '...</a>' );
},
async: true,
type: 'GET',
url: url,
success: function () {
// Reload the page.
location.reload();
}
}
);
}
}
}
);
}
);
/**
* Remove activate button and replace with activation in progress button.
*
* @package abiz
*/
jQuery( document ).ready(
function ($) {
$( 'body' ).on(
'click', ' .abiz-install-plugin ', function () {
var slug = $( this ).attr( 'data-slug' );
wp.updates.installPlugin(
{
slug: slug
}
);
return false;
}
);
$( '.activate-now' ).on(
'click', function (e) {
var activateButton = $( this );
e.preventDefault();
if ($( activateButton ).length) {
var url = $( activateButton ).attr( 'href' );
if (typeof url !== 'undefined') {
// Request plugin activation.
$.ajax(
{
beforeSend: function () {
$( activateButton ).replaceWith( '<a class="button updating-message">'+"activating"+'...</a>' );
},
async: true,
type: 'GET',
url: url,
success: function () {
// Reload the page.
location.reload();
}
}
);
}
}
}
);
}
);

View File

@@ -0,0 +1,849 @@
<?php if ( ! class_exists( 'WP_Customize_Control' ) ) {
return null;
}
class ABIZ_Repeater extends WP_Customize_Control {
public $id;
private $boxtitle = array();
private $add_field_label = array();
private $customizer_repeater_title_control = false;
private $customizer_repeater_subtitle_control = false;
private $customizer_repeater_subtitle2_control = false;
private $customizer_repeater_button_text_control = false;
private $customizer_repeater_link_control = false;
private $customizer_repeater_align_control = false;
private $customizer_repeater_video_url_control = false;
private $customizer_repeater_image_control = false;
private $customizer_repeater_icon_control = false;
private $customizer_repeater_color_control = false;
private $customizer_repeater_text_control = false;
public $customizer_repeater_text2_control = false;
public $customizer_repeater_button2_control = false;
public $customizer_repeater_link2_control = false;
public $customizer_repeater_btn3_control = false;
public $customizer_repeater_link3_control = false;
private $customizer_repeater_designation_control = false;
private $customizer_repeater_shortcode_control = false;
private $customizer_repeater_repeater_control = false;
private $customizer_repeater_checkbox_control = false;
private $customizer_icon_container = '';
private $allowed_html = array();
/*Class constructor*/
public function __construct( $manager, $id, $args = array() ) {
parent::__construct( $manager, $id, $args );
/*Get options from customizer.php*/
$this->add_field_label = esc_html__( 'Add new field', 'abiz' );
if ( ! empty( $args['add_field_label'] ) ) {
$this->add_field_label = $args['add_field_label'];
}
$this->boxtitle = esc_html__( 'Customizer Repeater', 'abiz' );
if ( ! empty ( $args['item_name'] ) ) {
$this->boxtitle = $args['item_name'];
} elseif ( ! empty( $this->label ) ) {
$this->boxtitle = $this->label;
}
if ( ! empty( $args['customizer_repeater_image_control'] ) ) {
$this->customizer_repeater_image_control = $args['customizer_repeater_image_control'];
}
if ( ! empty( $args['customizer_repeater_icon_control'] ) ) {
$this->customizer_repeater_icon_control = $args['customizer_repeater_icon_control'];
}
if ( ! empty( $args['customizer_repeater_color_control'] ) ) {
$this->customizer_repeater_color_control = $args['customizer_repeater_color_control'];
}
if ( ! empty( $args['customizer_repeater_title_control'] ) ) {
$this->customizer_repeater_title_control = $args['customizer_repeater_title_control'];
}
if ( ! empty( $args['customizer_repeater_subtitle_control'] ) ) {
$this->customizer_repeater_subtitle_control = $args['customizer_repeater_subtitle_control'];
}
if ( ! empty( $args['customizer_repeater_subtitle2_control'] ) ) {
$this->customizer_repeater_subtitle2_control = $args['customizer_repeater_subtitle2_control'];
}
if ( ! empty( $args['customizer_repeater_btn3_control'] ) ) {
$this->customizer_repeater_btn3_control = $args['customizer_repeater_btn3_control'];
}
if ( ! empty( $args['customizer_repeater_text_control'] ) ) {
$this->customizer_repeater_text_control = $args['customizer_repeater_text_control'];
}
if ( ! empty( $args['customizer_repeater_text2_control'] ) ) {
$this->customizer_repeater_text2_control = $args['customizer_repeater_text2_control'];
}
if ( ! empty( $args['customizer_repeater_button2_control'] ) ) {
$this->customizer_repeater_button2_control = $args['customizer_repeater_button2_control'];
}
if ( ! empty( $args['customizer_repeater_link2_control'] ) ) {
$this->customizer_repeater_link2_control = $args['customizer_repeater_link2_control'];
}
if ( ! empty( $args['customizer_repeater_link3_control'] ) ) {
$this->customizer_repeater_link3_control = $args['customizer_repeater_link3_control'];
}
if ( ! empty( $args['customizer_repeater_designation_control'] ) ) {
$this->customizer_repeater_designation_control = $args['customizer_repeater_designation_control'];
}
if ( ! empty( $args['customizer_repeater_button_text_control'] ) ) {
$this->customizer_repeater_button_text_control = $args['customizer_repeater_button_text_control'];
}
if ( ! empty( $args['customizer_repeater_link_control'] ) ) {
$this->customizer_repeater_link_control = $args['customizer_repeater_link_control'];
}
if ( ! empty( $args['customizer_repeater_checkbox_control'] ) ) {
$this->customizer_repeater_checkbox_control = $args['customizer_repeater_checkbox_control'];
}
if ( ! empty( $args['customizer_repeater_video_url_control'] ) ) {
$this->customizer_repeater_video_url_control = $args['customizer_repeater_video_url_control'];
}
if ( ! empty( $args['customizer_repeater_align_control'] ) ) {
$this->customizer_repeater_align_control = $args['customizer_repeater_align_control'];
}
if ( ! empty( $args['customizer_repeater_shortcode_control'] ) ) {
$this->customizer_repeater_shortcode_control = $args['customizer_repeater_shortcode_control'];
}
if ( ! empty( $args['customizer_repeater_repeater_control'] ) ) {
$this->customizer_repeater_repeater_control = $args['customizer_repeater_repeater_control'];
}
if ( ! empty( $id ) ) {
$this->id = $id;
}
if ( file_exists( get_template_directory() . '/core/customizer/customizer-repeater/inc/icons.php' ) ) {
$this->customizer_icon_container = 'core/customizer/customizer-repeater/inc/icons';
}
$allowed_array1 = wp_kses_allowed_html( 'post' );
$allowed_array2 = array(
'input' => array(
'type' => array(),
'class' => array(),
'placeholder' => array()
)
);
$this->allowed_html = array_merge( $allowed_array1, $allowed_array2 );
}
/*Enqueue resources for the control*/
public function enqueue() {
wp_enqueue_style( 'all-css', get_template_directory_uri() . '/assets/css/all.min.css', array(), 999 );
wp_enqueue_style( 'abiz_customizer-repeater-admin-stylesheet', get_template_directory_uri() . '/core/customizer/customizer-repeater/css/admin-style.css', array(), 999 );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'abiz_customizer-repeater-script', get_template_directory_uri() . '/core/customizer/customizer-repeater/js/customizer_repeater.js', array('jquery', 'jquery-ui-draggable', 'wp-color-picker' ), 999, true );
wp_enqueue_script( 'abiz_customizer-repeater-fontawesome-iconpicker', get_template_directory_uri() . '/core/customizer/customizer-repeater/js/fontawesome-iconpicker.js', array( 'jquery' ), 999, true );
wp_enqueue_style( 'abiz_customizer-repeater-fontawesome-iconpicker-script', get_template_directory_uri() . '/core/customizer/customizer-repeater/css/fontawesome-iconpicker.min.css', array(), 999 );
}
public function render_content() {
/*Get default options*/
$this_default = json_decode( $this->setting->default );
/*Get values (json format)*/
$values = $this->value();
/*Decode values*/
$json = json_decode( $values );
if ( ! is_array( $json ) ) {
$json = array( $values );
} ?>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<div class="customizer-repeater-general-control-repeater customizer-repeater-general-control-droppable">
<?php
if ( ( count( $json ) == 1 && '' === $json[0] ) || empty( $json ) ) {
if ( ! empty( $this_default ) ) {
$this->iterate_array( $this_default ); ?>
<input type="hidden"
id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
class="customizer-repeater-colector"
value="<?php echo esc_textarea( json_encode( $this_default ) ); ?>"/>
<?php
} else {
$this->iterate_array(); ?>
<input type="hidden"
id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
class="customizer-repeater-colector"/>
<?php
}
} else {
$this->iterate_array( $json ); ?>
<input type="hidden" id="customizer-repeater-<?php echo esc_attr( $this->id ); ?>-colector" <?php esc_attr( $this->link() ); ?>
class="customizer-repeater-colector" value="<?php echo esc_textarea( $this->value() ); ?>"/>
<?php
} ?>
</div>
<button type="button" class="button add_field customizer-repeater-new-field">
<?php echo esc_html( $this->add_field_label ); ?>
</button>
<?php
}
private function iterate_array($array = array()){
/*Counter that helps checking if the box is first and should have the delete button disabled*/
$it = 0;
if(!empty($array)){
$exist_service=count($array);
$abiz_del_btn_id=$this->boxtitle;
global $abiz_limit;
global $abiz_type_with_id;
echo sprintf("<input type='hidden' value='$exist_service' id='exist_abiz_$abiz_del_btn_id'/>");
foreach($array as $icon){
if($it<4)
{
$abiz_limit="abiz_limit";
$abiz_type_with_id='';
}
else
{
$abiz_limit="abiz_overlimit";
$abiz_type_with_id=$abiz_del_btn_id."_".$it;
}
?>
<div class="customizer-repeater-general-control-repeater-container customizer-repeater-draggable">
<div class="customizer-repeater-customize-control-title">
<?php echo esc_html( $this->boxtitle ) ?>
</div>
<div class="customizer-repeater-box-content-hidden">
<?php
$choice = $image_url = $icon_value = $title = $subtitle = $subtitle2 = $text = $text2 = $link2 = $button_second = $link = $btn3 = $link3 = $designation = $align = $button = $open_new_tab = $shortcode = $repeater = $color = $video_url = '';
if(!empty($icon->id)){
$id = $icon->id;
}
if(!empty($icon->choice)){
$choice = $icon->choice;
}
if(!empty($icon->image_url)){
$image_url = $icon->image_url;
}
if(!empty($icon->icon_value)){
$icon_value = $icon->icon_value;
}
if(!empty($icon->color)){
$color = $icon->color;
}
if(!empty($icon->title)){
$title = $icon->title;
}
if(!empty($icon->align)){
$align = $icon->align;
}
if(!empty($icon->designation)){
$designation = $icon->designation;
}
if(!empty($icon->subtitle)){
$subtitle = $icon->subtitle;
}
if(!empty($icon->subtitle2)){
$subtitle2 = $icon->subtitle2;
}
if(!empty($icon->text)){
$text = $icon->text;
}
if(!empty($icon->text2)){
$text2 = $icon->text2;
}
if(!empty($icon->button_second)){
$button_second = $icon->button_second;
}
if(!empty($icon->link2)){
$link2 = $icon->link2;
}
if(!empty($icon->btn3)){
$btn3 = $icon->btn3;
}
if(!empty($icon->link3)){
$link3 = $icon->link3;
}
if(!empty($icon->video_url)){
$video_url = $icon->video_url;
}
if(!empty($icon->button)){
$button = $icon->button_text;
}
if(!empty($icon->link)){
$link = $icon->link;
}
if(!empty($icon->shortcode)){
$shortcode = $icon->shortcode;
}
if(!empty($icon->social_repeater)){
$repeater = $icon->social_repeater;
}
if(!empty($icon->open_new_tab)){
$open_new_tab = $icon->open_new_tab;
}
if($this->customizer_repeater_title_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Title','abiz' ), $this->id, 'customizer_repeater_title_control' ),
'class' => 'customizer-repeater-title-control '."$abiz_limit".' '."$abiz_type_with_id".'',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
), $title);
}
if($this->customizer_repeater_subtitle_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Subtitle','abiz' ), $this->id, 'customizer_repeater_subtitle_control' ),
'class' => 'customizer-repeater-subtitle-control '."$abiz_limit".' '."$abiz_type_with_id".'',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
), $subtitle);
}
if($this->customizer_repeater_subtitle2_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Subtitle 2','abiz' ), $this->id, 'customizer_repeater_subtitle2_control' ),
'class' => 'customizer-repeater-subtitle2-control '."$abiz_limit".' '."$abiz_type_with_id".'',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle2_control' ),
), $subtitle2);
}
if($this->customizer_repeater_text_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Description','abiz' ), $this->id, 'customizer_repeater_text_control' ),
'class' => 'customizer-repeater-text-control '."$abiz_limit".' '."$abiz_type_with_id".'',
'type' => apply_filters('abiz_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
), $text);
}
if($this->customizer_repeater_text2_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Button Label','abiz' ), $this->id, 'customizer_repeater_text2_control' ),
'class' => 'customizer-repeater-text2-control '."$abiz_limit".'',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_text2_control' ),
), $text2);
}
if($this->customizer_repeater_link_control){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Link','abiz' ), $this->id, 'customizer_repeater_link_control' ),
'class' => 'customizer-repeater-link-control '."$abiz_limit".' '."$abiz_type_with_id".'',
'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
), $link);
}
if($this->customizer_repeater_button2_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Button Label second','abiz' ), $this->id, 'customizer_repeater_button2_control' ),
'class' => 'customizer-repeater-button2-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_button2_control' ),
), $button_second);
}
if($this->customizer_repeater_link2_control){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'link','abiz' ), $this->id, 'customizer_repeater_link2_control' ),
'class' => 'customizer-repeater-link2-control '."$abiz_limit".' '."$abiz_type_with_id".'',
//'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ),
), $link2);
}
if($this->customizer_repeater_button_text_control){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__('Button Text',
'abiz'), $this->id, 'customizer_repeater_button_text_control'),
'class' => 'customizer-repeater-button-text-control '."$abiz_limit".'',
'type' => apply_filters('abiz_repeater_input_types_filter', '' , $this->id,
'customizer_repeater_button_text_control'),
), $button);
}
if($this->customizer_repeater_btn3_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Button Label Third','abiz' ), $this->id, 'customizer_repeater_btn3_control' ),
'class' => 'customizer-repeater-btn3-control '."$abiz_limit".' '."$abiz_type_with_id".'',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_btn3_control' ),
), $btn3);
}
if($this->customizer_repeater_link3_control){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'link','abiz' ), $this->id, 'customizer_repeater_link3_control' ),
'class' => 'customizer-repeater-link3-control '."$abiz_limit".' '."$abiz_type_with_id".'',
//'sanitize_callback' => 'esc_url_raw',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link3_control' ),
), $link3);
}
if($this->customizer_repeater_checkbox_control == true){
$this->testimonila_check($open_new_tab);
}
if($this->customizer_repeater_video_url_control){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__('Video Url',
'abiz'), $this->id, 'customizer_repeater_video_url_control'),
'class' => 'customizer-repeater-video-url-control',
'type' => apply_filters('abiz_customizer_repeater_video_url_control', 'textarea', $this->id, 'customizer_repeater_video_url_control' ),
), $video_url);
}
if($this->customizer_repeater_align_control == true){
$this->align($align);
}
if($this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true) {
$this->icon_type_choice( $choice,$abiz_limit );
}
if($this->customizer_repeater_image_control == true){
$this->image_control($image_url, $choice, $abiz_limit, $it+1, $abiz_del_btn_id);
}
if($this->customizer_repeater_icon_control == true){
$this->icon_picker_control($icon_value, $choice);
}
if($this->customizer_repeater_color_control == true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Color','abiz' ), $this->id, 'customizer_repeater_color_control' ),
'class' => 'customizer-repeater-color-control',
'type' => apply_filters('abiz_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
'sanitize_callback' => 'sanitize_hex_color'
), $color);
}
if($this->customizer_repeater_shortcode_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Shortcode','abiz' ), $this->id, 'customizer_repeater_shortcode_control' ),
'class' => 'customizer-repeater-shortcode-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
), $shortcode);
}
if($this->customizer_repeater_designation_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Designation','abiz' ), $this->id, 'customizer_repeater_designation_control' ),
'class' => 'customizer-repeater-designation-control',
'type' => apply_filters('abiz_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_designation_control' ),
), $designation);
}
if($this->customizer_repeater_repeater_control==true){
$this->repeater_control($repeater, $abiz_limit, $abiz_type_with_id);
} ?>
<input type="hidden" class="social-repeater-box-id" value="<?php if ( ! empty( $id ) ) {
echo esc_attr( $id );
} ?>">
<button type="button" class="social-repeater-general-control-remove-field" <?php if ( $it == 0 ) {
echo esc_attr('style=display:none;');
} ?>>
<?php printf( __( 'Delete %s', 'abiz' ), $this->boxtitle ); ?>
</button>
</div>
</div>
<?php
$it++;
}
} else { ?>
<div class="customizer-repeater-general-control-repeater-container">
<div class="customizer-repeater-customize-control-title">
<?php echo esc_html( $this->boxtitle ) ?>
</div>
<div class="customizer-repeater-box-content-hidden">
<?php
if ( $this->customizer_repeater_image_control == true && $this->customizer_repeater_icon_control == true ) {
$this->icon_type_choice();
}
if ( $this->customizer_repeater_image_control == true ) {
$this->image_control();
}
if ( $this->customizer_repeater_icon_control == true ) {
$this->icon_picker_control();
}
if($this->customizer_repeater_color_control==true){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Color','abiz' ), $this->id, 'customizer_repeater_color_control' ),
'class' => 'customizer-repeater-color-control',
'type' => apply_filters('abiz_repeater_input_types_filter', 'color', $this->id, 'customizer_repeater_color_control' ),
'sanitize_callback' => 'sanitize_hex_color'
) );
}
if ( $this->customizer_repeater_title_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Title','abiz' ), $this->id, 'customizer_repeater_title_control' ),
'class' => 'customizer-repeater-title-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_title_control' ),
) );
}
if ( $this->customizer_repeater_subtitle_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Subtitle','abiz' ), $this->id, 'customizer_repeater_subtitle_control' ),
'class' => 'customizer-repeater-subtitle-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle_control' ),
) );
}
if ( $this->customizer_repeater_subtitle2_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Subtitle 2','abiz' ), $this->id, 'customizer_repeater_subtitle2_control' ),
'class' => 'customizer-repeater-subtitle-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_subtitle2_control' ),
) );
}
if ( $this->customizer_repeater_text_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Description','abiz' ), $this->id, 'customizer_repeater_text_control' ),
'class' => 'customizer-repeater-text-control',
'type' => apply_filters('abiz_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_text_control' ),
) );
}
if ( $this->customizer_repeater_text2_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Button Label','abiz' ), $this->id, 'customizer_repeater_text2_control' ),
'class' => 'customizer-repeater-text2-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_text2_control' ),
) );
}
if ( $this->customizer_repeater_button2_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Button Label Second','abiz' ), $this->id, 'customizer_repeater_button2_control' ),
'class' => 'customizer-repeater-button2-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_button2_control' ),
) );
}
if ( $this->customizer_repeater_link2_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'link','abiz' ), $this->id, 'customizer_repeater_link2_control' ),
'class' => 'customizer-repeater-link2-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link2_control' ),
) );
}
if($this->customizer_repeater_button_text_control){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__('Button Text',
'abiz'), $this->id, 'customizer_repeater_button_text_control'),
'class' => 'customizer-repeater-button-text-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '' , $this->id,
'customizer_repeater_button_text_control'),
));
}
if ( $this->customizer_repeater_link_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Link','abiz' ), $this->id, 'customizer_repeater_link_control' ),
'class' => 'customizer-repeater-link-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link_control' ),
) );
}
if ( $this->customizer_repeater_btn3_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Button Label 3','abiz' ), $this->id, 'customizer_repeater_btn3_control' ),
'class' => 'customizer-repeater-btn3-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_btn3_control' ),
) );
}
if ( $this->customizer_repeater_link3_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'link','abiz' ), $this->id, 'customizer_repeater_link3_control' ),
'class' => 'customizer-repeater-link3-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_link3_control' ),
) );
}
if($this->customizer_repeater_checkbox_control == true){
$this->testimonila_check();
}
if($this->customizer_repeater_video_url_control){
$this->input_control(array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__('Video Url',
'abiz'), $this->id, 'customizer_repeater_video_url_control'),
'class' => 'customizer-repeater-video-url-control',
'type' => apply_filters('abiz_customizer_repeater_video_url_control', 'textarea', $this->id, 'customizer_repeater_video_url_control' ),
));
}
if($this->customizer_repeater_align_control == true){
$this->align($align);
}
if ( $this->customizer_repeater_shortcode_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Shortcode','abiz' ), $this->id, 'customizer_repeater_shortcode_control' ),
'class' => 'customizer-repeater-shortcode-control',
'type' => apply_filters('abiz_repeater_input_types_filter', '', $this->id, 'customizer_repeater_shortcode_control' ),
) );
}
if ( $this->customizer_repeater_designation_control == true ) {
$this->input_control( array(
'label' => apply_filters('abiz_repeater_input_labels_filter', esc_html__( 'Designation','abiz' ), $this->id, 'customizer_repeater_designation_control' ),
'class' => 'customizer-repeater-designation-control',
'type' => apply_filters('abiz_repeater_input_types_filter', 'textarea', $this->id, 'customizer_repeater_designation_control' ),
) );
}
if($this->customizer_repeater_repeater_control==true){
$this->repeater_control();
} ?>
<input type="hidden" class="social-repeater-box-id">
<button type="button" class="social-repeater-general-control-remove-field button" style="display:none;">
<?php esc_html_e( 'Delete field', 'abiz' ); ?>
</button>
</div>
</div>
<?php
}
}
private function input_control( $options, $value='' ){
//print_r($options);
?>
<span class="customize-control-title <?php echo esc_html( $options['label'] ); ?>"
<?php if($options['class']== 'customizer-repeater-video-url-control') {echo esc_attr('style="display:none;"'); }?>
><?php echo esc_html( $options['label'] ); ?></span>
<?php
if( !empty($options['type']) ){
switch ($options['type']) {
case 'textarea':?>
<textarea class="<?php echo esc_attr( $options['class'] ); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"><?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?></textarea>
<?php
break;
case 'color': ?>
<input type="text" value="<?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?>" class="<?php echo esc_attr($options['class']); ?>" />
<?php
break;
}
} else { ?>
<input type="text" value="<?php echo ( !empty($options['sanitize_callback']) ? call_user_func_array( $options['sanitize_callback'], array( $value ) ) : esc_attr($value) ); ?>" class="<?php echo esc_attr($options['class']); ?>" placeholder="<?php echo esc_attr( $options['label'] ); ?>"/>
<?php
}
}
private function testimonila_check($value='no', $class='', $abiz_type_with_id=''){
?>
<div class="customize-control-title">
<?php esc_html_e('Open link in new tab:','abiz'); ?>
<span class="switch">
<input type="checkbox" name="custom_checkbox" value="yes" <?php if($value=='yes'){echo esc_attr('checked');}?> class="customizer-repeater-checkbox <?php echo esc_attr($class);?> <?php echo esc_attr($abiz_type_with_id);?>">
</span>
</div>
<?php
}
private function icon_picker_control($value = '', $show = '', $class=''){ ?>
<div class="social-repeater-general-control-icon" <?php if( $show === 'customizer_repeater_image' || $show === 'customizer_repeater_none' ) { echo esc_attr('style="display:none;"'); } ?>>
<span class="customize-control-title">
<?php esc_html_e('Icon','abiz'); ?>
</span>
<span class="description customize-control-description">
<?php
echo sprintf(
esc_html__( 'Note: Some icons may not be displayed here. You can see the full list of icons at %1$s.', 'abiz' ),
sprintf( '<a href="http://fontawesome.io/icons/" rel="nofollow">%s</a>', esc_html__( 'http://fontawesome.io/icons/', 'abiz' ) )
); ?>
</span>
<div class="input-group icp-container">
<input data-placement="bottomRight" class="icp icp-auto" value="<?php if(!empty($value)) { echo esc_attr( $value );} ?>" type="text">
<span class="input-group-addon">
<i class="<?php echo esc_attr($value); ?>"></i>
</span>
</div>
<?php get_template_part( $this->customizer_icon_container ); ?>
</div>
<?php
}
private function image_control($value = '', $show = '', $class='', $auto='', $sections=''){
if($auto==1)
{
$auto="one";
}
if($auto==2)
{
$auto="two";
}
if($auto==3)
{
$auto="three";
}
if($auto==4)
{
$auto="four";
}
?>
<div class="customizer-repeater-image-control" <?php if( $show === 'customizer_repeater_icon' || $show === 'customizer_repeater_none' ) { echo esc_attr('style="display:none;"'); } ?>>
<span class="customize-control-title">
<?php esc_html_e('Image','abiz')?>
</span>
<input type="text" class="widefat custom-media-url <?php if($class="abiz_overlimit") { echo esc_attr('abiz-uploading-img');}?> <?php echo esc_attr($auto);?>" value="<?php echo esc_attr( $value ); ?>">
<input type="button" class="button button-secondary customizer-repeater-custom-media-button <?php if($class="abiz_overlimit") { echo esc_attr('abiz-uploading-img-btn');}?> <?php echo esc_attr($auto);?>" value="<?php esc_attr_e( 'Upload Image','abiz' ); ?>" />
</div>
<?php
}
private function align($value='left'){?>
<span class="customize-control-title">
<?php esc_html_e('Align','abiz'); ?>
</span>
<select class="customizer-repeater-align">
<option value="left" <?php selected($value,'left');?>>
<?php esc_html_e('Left','abiz') ?>
</option>
<option value="right" <?php selected($value,'right');?>>
<?php esc_html_e('Right','abiz') ?>
</option>
<option value="center" <?php selected($value,'center');?>>
<?php esc_html_e('Center','abiz') ?>
</option>
</select>
<?php
}
private function icon_type_choice($value='customizer_repeater_icon', $abiz_limit=''){ ?>
<span class="customize-control-title">
<?php esc_html_e('Image type','abiz');?>
</span>
<select class="customizer-repeater-image-choice <?php echo esc_attr($abiz_limit);?>">
<option value="customizer_repeater_icon" <?php selected($value,'customizer_repeater_icon');?>><?php esc_html_e('Icon','abiz'); ?></option>
<option value="customizer_repeater_image" <?php selected($value,'customizer_repeater_image');?>><?php esc_html_e('Image','abiz'); ?></option>
<option value="customizer_repeater_none" <?php selected($value,'customizer_repeater_none');?>><?php esc_html_e('None','abiz'); ?></option>
</select>
<?php
}
private function repeater_control($value = '', $abiz_limit='', $abiz_type_with_id=''){
$social_repeater = array();
$show_del = 0; ?>
<span class="customize-control-title"><?php esc_html_e( 'Social icons', 'abiz' ); ?></span>
<?php
if(!empty($value)) {
$social_repeater = json_decode( html_entity_decode( $value ), true );
}
if ( ( count( $social_repeater ) == 1 && '' === $social_repeater[0] ) || empty( $social_repeater ) ) { ?>
<div class="customizer-repeater-social-repeater">
<div class="customizer-repeater-social-repeater-container">
<div class="customizer-repeater-rc input-group icp-container">
<input data-placement="bottomRight" class="icp icp-auto" value="<?php if(!empty($value)) { echo esc_attr( $value ); } ?>" type="text">
<span class="input-group-addon"></span>
</div>
<?php get_template_part( $this->customizer_icon_container ); ?>
<input type="text" class="customizer-repeater-social-repeater-link team_linkdata_<?php echo $abiz_limit;?> <?php echo esc_attr($abiz_type_with_id);?>"
placeholder="<?php esc_attr_e( 'Link', 'abiz' ); ?>">
<input type="hidden" class="customizer-repeater-social-repeater-id" value="">
<button class="social-repeater-remove-social-item" style="display:none">
<?php esc_html_e( 'Remove Icon', 'abiz' ); ?>
</button>
</div>
<input type="hidden" id="social-repeater-socials-repeater-colector" class="social-repeater-socials-repeater-colector" value=""/>
</div>
<button class="social-repeater-add-social-item button-secondary "><?php esc_html_e( 'Add Icon', 'abiz' ); ?></button>
<?php
} else { ?>
<div class="customizer-repeater-social-repeater">
<?php
foreach ( $social_repeater as $social_icon ) {
$show_del ++; ?>
<div class="customizer-repeater-social-repeater-container">
<div class="customizer-repeater-rc input-group icp-container">
<input data-placement="bottomRight" class="icp icp-auto team_data_<?php echo esc_attr($abiz_limit);?> <?php echo esc_attr($abiz_type_with_id);?>" value="<?php if( !empty($social_icon['icon']) ) { echo esc_attr( $social_icon['icon'] ); } ?>" type="text">
<span class="input-group-addon"><i class="<?php echo esc_attr( $social_icon['icon'] ); ?>"></i></span>
</div>
<?php get_template_part( $this->customizer_icon_container ); ?>
<input type="text" class="customizer-repeater-social-repeater-link"
placeholder="<?php esc_attr_e( 'Link', 'abiz' ); ?>"
value="<?php if ( ! empty( $social_icon['link'] ) ) {
echo esc_url( $social_icon['link'] );
} ?>">
<input type="hidden" class="customizer-repeater-social-repeater-id"
value="<?php if ( ! empty( $social_icon['id'] ) ) {
echo esc_attr( $social_icon['id'] );
} ?>">
<button class="social-repeater-remove-social-item"
style="<?php if ( $show_del == 1 ) {
echo esc_attr("display:none");
} ?>"><?php esc_html_e( 'Remove Icon', 'abiz' ); ?></button>
</div>
<?php
} ?>
<input type="hidden" id="social-repeater-socials-repeater-colector"
class="social-repeater-socials-repeater-colector"
value="<?php echo esc_textarea( html_entity_decode( $value ) ); ?>" />
</div>
<button class="social-repeater-add-social-item button-secondary <?php echo esc_attr($abiz_limit);?> <?php echo esc_attr($abiz_type_with_id);?>"><?php esc_html_e( 'Add Icon', 'abiz' ); ?></button>
<?php
}
}
}

View File

@@ -0,0 +1,213 @@
.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden:after {
content: "";
display: table;
clear: both;
}
.customizer-repeater-general-control-repeater-container .customizer-repeater-box-content-hidden {
display: none;
}
.customizer-repeater-customize-control-title {
margin: 0;
padding: 15px;
font-size: 1em;
line-height: 1;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
display: block;
font-weight: 600;
color: #23282d;
border: 1px solid #e5e5e5;
cursor: move;
}
.customizer-repeater-customize-control-title:hover {
border: 1px solid #999;
}
.customizer-repeater-customize-control-title:after {
content: "\f140";
font-family: dashicons;
font-size: 20px;
height: 13px;
bottom: 3px;
position: relative;
float: right;
}
.customizer-repeater-customize-control-title.repeater-expanded:after {
content: "\f142";
}
.customizer-repeater-box-content-hidden {
border: 1px solid #e5e5e5;
border-top: none;
padding: 1px 10px 10px;
}
.customizer-repeater-box-content-hidden > div {
margin: 1em 0;
}
.customizer-repeater-box-content-hidden .customize-control-title {
font-size: 13px;
line-height: 1.5;
font-weight: normal;
margin-bottom: 0;
margin-top: 1em;
}
.customizer-repeater-box-content-hidden .customize-control-title:after {
content: ":";
}
.customizer-repeater-box-content-hidden span.description {
font-size: 12px;
font-style: normal;
}
.customizer-repeater-general-control-repeater-container, .customizer-repeater-general-control-repeater_container {
border: 1px solid #e5e5e5;
border-top: none;
margin-bottom: 12px;
width: 100%;
float: left;
background: #fff;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}
.customizer-repeater-box-content-hidden .wp-picker-container, .customizer-repeater-box-content-hidden .wp-picker-container .wp-color-result, .icp-container {
margin: 0;
}
.customizer-repeater-box-content-hidden input:not(.icp, .wp-color-picker),
.customizer-repeater-box-content-hidden textarea,
.customizer-repeater-box-content-hidden .wp-picker-container {
margin-bottom: 1em !important;
}
.social-repeater-general-control-remove-field {
cursor: pointer;
color: #a00;
background: none;
border: none;
padding: 0;
margin-top: 10px;
}
.social-repeater-general-control-remove-field:hover {
color: red;
}
.customizer-repeater-box-content-hidden .wp-picker-holder {
position: relative;
left: -10px;
}
.customizer-repeater-box-content-hidden .wp-picker-input-wrap {
margin-left: 10px;
}
.customizer-repeater-box-content-hidden .wp-picker-container .iris-picker {
border-left: none;
border-right: none;
}
button.customizer-repeater-new-field {
float: right;
}
button.customizer-repeater-new-field:before {
content: "\f132";
display: inline-block;
position: relative;
left: -2px;
top: -1px;
font: 400 20px/1 dashicons;
vertical-align: middle;
-webkit-transition: all .2s;
transition: all .2s;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.customizer-repeater-box-content-hidden > div.customizer-repeater-social-repeater {
margin-top: 0;
}
.customizer-repeater-general-control-repeater-container .customizer-repeater-icon-control {
width: 100%;
margin: 0;
padding: 0;
}
#customizer-repeater-new-field {
width: 100%;
}
.customize-control-widget_form .widget-control-save {
display: block !important;
}
.customizer-repeater-box-content-hidden {
background-color: #fff;
}
.customizer-repeater-image-control .customizer-repeater-custom-media-button {
margin-top: 5px;
}
.customizer-icons {
display: inline-block;
padding: 0 10px 0 0;
vertical-align: middle;
}
.social-repeater-remove-social-item {
display: inline-block;
vertical-align: top;
color: #a00;
border: none;
background: none;
cursor: pointer;
padding: 0;
}
.social-repeater-remove-social-item:hover {
color: red;
}
.customizer-repeater-social-repeater > .customizer-repeater-social-repeater-container:not(:first-child) {
margin-top: 25px;
}
.icp-container {
margin-bottom: 10px;
}
.button-secondary.social-repeater-add-social-item:before {
content: "\f132";
display: inline-block;
position: relative;
left: -2px;
top: -1px;
font: 400 20px/1 dashicons;
vertical-align: middle;
-webkit-transition: all .2s;
transition: all .2s;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.button-secondary.social-repeater-add-social-item {
vertical-align: text-top;
float: right;
}
.customizer-repeater-box-content-hidden textarea {
width: 100%;
}

View File

@@ -0,0 +1,156 @@
.iconpicker .iconpicker-items,
.iconpicker .iconpicker-items:after,
.iconpicker-popover .popover-footer:after,
.iconpicker:after {
clear: both
}
.iconpicker-popover.popover {
position: absolute;
padding: 1px;
text-align: left;
background: #e5e5e5;
z-index: 999;
display: none;
margin-left: -10px;
width: 254px
}
.iconpicker,
.iconpicker-popover.popover.iconpicker-visible {
display: block
}
.iconpicker-popover.popover .popover-title {
padding: 5px;
font-size: 5px;
line-height: 16px;
border-bottom: 1px solid #ebebeb;
background-color: #e5e5e5
}
.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search {
margin: 0 0 2px
}
.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search {
margin-top: 14px
}
.iconpicker-popover.popover .popover-content {
padding: 0;
text-align: center
}
.iconpicker-popover.popover>.arrow,
.iconpicker-popover.popover>.arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid
}
.iconpicker *,
.icp-container {
position: relative
}
.iconpicker-popover.popover>.arrow {
border-width: 11px
}
.iconpicker-popover.popover>.arrow:after {
border-width: 10px;
content: ""
}
.iconpicker-popover.popover.bottomLeft>.arrow {
border-top-width: 0;
border-bottom-color: #e5e5e5;
top: -11px
}
.iconpicker-popover.popover.bottomLeft>.arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #e5e5e5
}
.iconpicker-popover.popover.bottomLeft>.arrow {
left: 14px;
margin-left: 0
}
.iconpicker,
.iconpicker .iconpicker-items {
position: relative;
margin: 0;
overflow: hidden
}
.iconpicker {
text-align: left;
text-shadow: none;
line-height: 0
}
.iconpicker .iconpicker-items:after,
.iconpicker .iconpicker-items:before,
.iconpicker:after,
.iconpicker:before {
content: " ";
display: table
}
.iconpicker * {
box-sizing: content-box
}
.iconpicker .iconpicker-items {
float: none;
padding: 5px 0 0 5px;
background: #fff;
overflow-y: auto;
min-height: 55px;
max-height: 275px
}
.iconpicker .iconpicker-items i {
float: left;
width: 32px;
height: 32px;
line-height: 32px;
margin: 0 7px 7px 0;
text-align: center;
cursor: pointer;
border-radius: 3px;
font-size: 18px;
color: #444;
box-shadow: 0 0 0 1px #ddd;
transition: transform .2s ease
}
.iconpicker .iconpicker-items i:nth-child(6n) {
margin-right: 0
}
.iconpicker .iconpicker-items i:hover {
transform: scale(1.4);
color: #008ec2;
box-shadow: none
}
.icp {
padding-left: 30px
}
.icp-container .input-group-addon {
position: absolute;
top: 1px;
left: 5px;
padding: 3px
}

View File

@@ -0,0 +1 @@
.iconpicker .iconpicker-items,.iconpicker .iconpicker-items:after,.iconpicker-popover .popover-footer:after,.iconpicker:after{clear:both}.iconpicker-popover.popover{position:absolute;padding:1px;text-align:left;background:#e5e5e5;z-index:999;display:none;margin-left:-10px;width:254px}.iconpicker,.iconpicker-popover.popover.iconpicker-visible{display:block}.iconpicker-popover.popover .popover-title{padding:5px;font-size:5px;line-height:16px;border-bottom:1px solid #ebebeb;background-color:#e5e5e5}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px}.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search{margin-top:14px}.iconpicker-popover.popover .popover-content{padding:0;text-align:center}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker *,.icp-container{position:relative}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.bottomLeft>.arrow{border-top-width:0;border-bottom-color:#e5e5e5;top:-11px}.iconpicker-popover.popover.bottomLeft>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#e5e5e5}.iconpicker-popover.popover.bottomLeft>.arrow{left:14px;margin-left:0}.iconpicker,.iconpicker .iconpicker-items{position:relative;margin:0;overflow:hidden}.iconpicker{text-align:left;text-shadow:none;line-height:0}.iconpicker .iconpicker-items:after,.iconpicker .iconpicker-items:before,.iconpicker:after,.iconpicker:before{content:" ";display:table}.iconpicker *{box-sizing:content-box}.iconpicker .iconpicker-items{float:none;padding:5px 0 0 5px;background:#fff;overflow-y:auto;min-height:55px;max-height:275px}.iconpicker .iconpicker-items i{float:left;width:32px;height:32px;line-height:32px;margin:0 7px 7px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:18px;color:#444;box-shadow:0 0 0 1px #ddd;transition:transform .2s ease}.iconpicker .iconpicker-items i:nth-child(6n){margin-right:0}.iconpicker .iconpicker-items i:hover{transform:scale(1.4);color:#008ec2;box-shadow:none}.icp{padding-left:30px !important}.icp-container .input-group-addon{position:absolute;top:1px;left:5px;padding:3px}

View File

@@ -0,0 +1,34 @@
<?php
function abiz_repeater_register( $wp_customize ) {
require_once ABIZ_THEME_CORE_DIR . '/customizer/customizer-repeater/class/customizer-repeater-control.php';
}
add_action( 'customize_register', 'abiz_repeater_register' );
function abiz_repeater_sanitize($input){
$input_decoded = json_decode($input,true);
if(!empty($input_decoded)) {
foreach ($input_decoded as $boxk => $box ){
foreach ($box as $key => $value){
switch ( $key ) {
case 'icon_value':
$input_decoded[$boxk][$key] = wp_kses_post( force_balance_tags( $value ) );
break;
case 'link':
$input_decoded[$boxk][$key] = esc_url_raw( $value );
break;
default:
$input_decoded[$boxk][$key] = wp_kses_post( force_balance_tags( $value ) );
}
}
}
return json_encode($input_decoded);
}
return $input;
}

View File

@@ -0,0 +1,87 @@
<div class="iconpicker-popover popover bottomLeft">
<div class="arrow"></div>
<div class="popover-title">
<input type="search" class="form-control iconpicker-search" placeholder="Type to filter">
</div>
<div class="popover-content">
<div class="iconpicker">
<div class="iconpicker-items">
<i data-type="iconpicker-item" title=".fa-behance" class="fab fa-behance" data-icon=""></i>
<i data-type="iconpicker-item" title=".fa-behance-square" class="fab fa-behance-square"></i>
<i data-type="iconpicker-item" title=".fa-facebook-f" class="fab fa-facebook-f"></i>
<i data-type="iconpicker-item" title=".fa-facebook-square" class="fab fa-facebook-square"></i>
<i data-type="iconpicker-item" title=".fa-google-plus-g" class="fab fa-google-plus-g"></i>
<i data-type="iconpicker-item" title=".fa-google-plus-square" class="fab fa-google-plus-square"></i>
<i data-type="iconpicker-item" title=".fa-linkedin-in" class="fab fa-linkedin-in"></i>
<i data-type="iconpicker-item" title=".fa-linkedin" class="fab fa-linkedin"></i>
<i data-type="iconpicker-item" title=".fa-twitter" class="fab fa-twitter"></i>
<i data-type="iconpicker-item" title=".fa-twitter-square" class="fab fa-twitter-square"></i>
<i data-type="iconpicker-item" title=".fa-vimeo-v" class="fab fa-vimeo-v"></i>
<i data-type="iconpicker-item" title=".fa-vimeo-square" class="fab fa-vimeo-square"></i>
<i data-type="iconpicker-item" title=".fa-youtube" class="fab fa-youtube"></i>
<i data-type="iconpicker-item" title=".fa-youtube-square" class="fab fa-youtube-square"></i>
<i data-type="iconpicker-item" title=".fa-ambulance" class="fas fa-ambulance"></i>
<i data-type="iconpicker-item" title=".fa-american-sign-language-interpreting" class="fas fa-american-sign-language-interpreting"></i>
<i data-type="iconpicker-item" title=".fa-anchor" class="fas fa-anchor"></i>
<i data-type="iconpicker-item" title=".fa-android" class="fab fa-android"></i>
<i data-type="iconpicker-item" title=".fa-apple" class="fab fa-apple"></i>
<i data-type="iconpicker-item" title=".fa-archive" class="fas fa-archive"></i>
<i data-type="iconpicker-item" title=".fa-chart-area" class="fas fa-chart-area"></i>
<i data-type="iconpicker-item" title=".fa-asterisk" class="fas fa-asterisk"></i>
<i data-type="iconpicker-item" title=".fa-car" class="fas fa-car"></i>
<i data-type="iconpicker-item" title=".fa-balance-scale" class="fas fa-balance-scale"></i>
<i data-type="iconpicker-item" title=".fa-ban" class="fas fa-ban"></i>
<i data-type="iconpicker-item" title=".fa-university" class="fas fa-university"></i>
<i data-type="iconpicker-item" title=".fa-bicycle" class="fas fa-bicycle"></i>
<i data-type="iconpicker-item" title=".fa-birthday-cake" class="fas fa-birthday-cake"></i>
<i data-type="iconpicker-item" title=".fa-btc" class="fab fa-btc"></i>
<i data-type="iconpicker-item" title=".fa-black-tie" class="fab fa-black-tie"></i>
<i data-type="iconpicker-item" title=".fa-bookmark" class="fas fa-bookmark"></i>
<i data-type="iconpicker-item" title=".fa-briefcase" class="fas fa-briefcase"></i>
<i data-type="iconpicker-item" title=".fa-bus" class="fas fa-bus"></i>
<i data-type="iconpicker-item" title=".fa-taxi" class="fas fa-taxi"></i>
<i data-type="iconpicker-item" title=".fa-camera" class="fas fa-camera"></i>
<i data-type="iconpicker-item" title=".fa-check" class="fas fa-check"></i>
<i data-type="iconpicker-item" title=".fa-child" class="fas fa-child"></i>
<i data-type="iconpicker-item" title=".fa-code" class="fas fa-code"></i>
<i data-type="iconpicker-item" title=".fa-coffee" class="fas fa-coffee"></i>
<i data-type="iconpicker-item" title=".fa-cog" class="fas fa-cog"></i>
<i data-type="iconpicker-item" title=".fa-comment-dots" class="fas fa-comment-dots"></i>
<i data-type="iconpicker-item" title=".fa-cube" class="fas fa-cube"></i>
<i data-type="iconpicker-item" title=".fa-dollar-sign" class="fas fa-dollar-sign"></i>
<i data-type="iconpicker-item" title=".fa-gem" class="far fa-gem"></i>
<i data-type="iconpicker-item" title=".fa-envelope" class="fas fa-envelope"></i>
<i data-type="iconpicker-item" title=".fa-female" class="fas fa-female"></i>
<i data-type="iconpicker-item" title=".fa-fire-extinguisher" class="fas fa-fire-extinguisher"></i>
<i data-type="iconpicker-item" title=".fa-glass-martini" class="fas fa-glass-martini"></i>
<i data-type="iconpicker-item" title=".fa-globe" class="fas fa-globe"></i>
<i data-type="iconpicker-item" title=".fa-graduation-cap" class="fas fa-graduation-cap"></i>
<i data-type="iconpicker-item" title=".fa-heartbeat" class="fas fa-heartbeat"></i>
<i data-type="iconpicker-item" title=".fa-heart" class="fas fa-heart"></i>
<i data-type="iconpicker-item" title=".fa-bed" class="fas fa-bed"></i>
<i data-type="iconpicker-item" title=".fa-hourglass" class="fas fa-hourglass"></i>
<i data-type="iconpicker-item" title=".fa-home" class="fas fa-home"></i>
<i data-type="iconpicker-item" title=".fa-gavel" class="fas fa-gavel"></i>
<i data-type="iconpicker-item" title=".fa-lock" class="fas fa-lock"></i>
<i data-type="iconpicker-item" title=".fa-map-signs" class="fas fa-map-signs"></i>
<i data-type="iconpicker-item" title=".fa-paint-brush" class="fas fa-paint-brush"></i>
<i data-type="iconpicker-item" title=".fa-plane" class="fas fa-plane"></i>
<i data-type="iconpicker-item" title=".fa-rocket" class="fas fa-rocket"></i>
<i data-type="iconpicker-item" title=".fa-puzzle-piece" class="fas fa-puzzle-piece"></i>
<i data-type="iconpicker-item" title=".fa-shield-alt" class="fas fa-shield-alt"></i>
<i data-type="iconpicker-item" title=".fa-tag" class="fas fa-tag"></i>
<i data-type="iconpicker-item" title=".fa-times" class="fas fa-times"></i>
<i data-type="iconpicker-item" title=".fa-unlock" class="fas fa-unlock"></i>
<i data-type="iconpicker-item" title=".fa-user" class="fas fa-user"></i>
<i data-type="iconpicker-item" title=".fa-user-md" class="fas fa-user-md"></i>
<i data-type="iconpicker-item" title=".fa-video" class="fas fa-video"></i>
<i data-type="iconpicker-item" title=".fa-wordpress" class="fab fa-wordpress"></i>
<i data-type="iconpicker-item" title=".fa-wrench" class="fas fa-wrench"></i>
<i data-type="iconpicker-item" title=".fa-chart-line" class="fas fa-chart-line"></i>
<i data-type="iconpicker-item" title=".fa-chart-area" class="fas fa-chart-area"></i>
<i data-type="iconpicker-item" title=".fa-signal" class="fas fa-signal"></i>
<i data-type="iconpicker-item" title=".fa-500px" class="fab fa-500px"></i>
</div> <!-- /.iconpicker-items -->
</div> <!-- /.iconpicker -->
</div> <!-- /.popover-content -->
</div> <!-- /.iconpicker-popover -->

View File

@@ -0,0 +1,584 @@
/* global jQuery */
/* global wp */
function abiz_media_upload(button_class) {
'use strict';
jQuery('body').on('click', button_class, function () {
var button_id = '#' + jQuery(this).attr('id');
var display_field = jQuery(this).parent().children('input:text');
var _custom_media = true;
wp.media.editor.send.attachment = function (props, attachment) {
if (_custom_media) {
if (typeof display_field !== 'undefined') {
switch (props.size) {
case 'full':
display_field.val(attachment.sizes.full.url);
display_field.trigger('change');
break;
case 'medium':
display_field.val(attachment.sizes.medium.url);
display_field.trigger('change');
break;
case 'thumbnail':
display_field.val(attachment.sizes.thumbnail.url);
display_field.trigger('change');
break;
default:
display_field.val(attachment.url);
display_field.trigger('change');
}
}
_custom_media = false;
} else {
return wp.media.editor.send.attachment(button_id, [props, attachment]);
}
};
wp.media.editor.open(button_class);
window.send_to_editor = function (html) {
};
return false;
});
}
/********************************************
*** Generate unique id ***
*********************************************/
function abiz_customizer_repeater_uniqid(prefix, more_entropy) {
'use strict';
if (typeof prefix === 'undefined') {
prefix = '';
}
var retId;
var php_js;
var formatSeed = function (seed, reqWidth) {
seed = parseInt(seed, 10)
.toString(16); // to hex str
if (reqWidth < seed.length) { // so long we split
return seed.slice(seed.length - reqWidth);
}
if (reqWidth > seed.length) { // so short we pad
return new Array(1 + (reqWidth - seed.length))
.join('0') + seed;
}
return seed;
};
// BEGIN REDUNDANT
if (!php_js) {
php_js = {};
}
// END REDUNDANT
if (!php_js.uniqidSeed) { // init seed with big random int
php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
}
php_js.uniqidSeed++;
retId = prefix; // start with prefix, add current milliseconds hex string
retId += formatSeed(parseInt(new Date()
.getTime() / 1000, 10), 8);
retId += formatSeed(php_js.uniqidSeed, 5); // add seed hex string
if (more_entropy) {
// for more entropy we add a float lower to 10
retId += (Math.random() * 10)
.toFixed(8)
.toString();
}
return retId;
}
/********************************************
*** General Repeater ***
*********************************************/
function abiz_customizer_repeater_refresh_social_icons(th) {
'use strict';
var icons_repeater_values = [];
th.find('.customizer-repeater-social-repeater-container').each(function () {
var icon = jQuery(this).find('.icp').val();
var link = jQuery(this).find('.customizer-repeater-social-repeater-link').val();
var id = jQuery(this).find('.customizer-repeater-social-repeater-id').val();
if (!id) {
id = 'customizer-repeater-social-repeater-' + abiz_customizer_repeater_uniqid();
jQuery(this).find('.customizer-repeater-social-repeater-id').val(id);
}
if (icon !== '' && link !== '') {
icons_repeater_values.push({
'icon': icon,
'link': link,
'id': id
});
}
});
th.find('.social-repeater-socials-repeater-colector').val(JSON.stringify(icons_repeater_values));
abiz_customizer_repeater_refresh_general_control_values();
}
function abiz_customizer_repeater_refresh_general_control_values() {
'use strict';
jQuery('.customizer-repeater-general-control-repeater').each(function () {
var values = [];
var th = jQuery(this);
th.find('.customizer-repeater-general-control-repeater-container').each(function () {
var icon_value = jQuery(this).find('.icp').val();
var text = jQuery(this).find('.customizer-repeater-text-control').val();
var link = jQuery(this).find('.customizer-repeater-link-control').val();
var text2 = jQuery(this).find('.customizer-repeater-text2-control').val();
var link2 = jQuery(this).find('.customizer-repeater-link2-control').val();
var link3 = jQuery(this).find('.customizer-repeater-link3-control').val();
var color = jQuery(this).find('input.customizer-repeater-color-control').val();
var color2 = jQuery(this).find('input.customizer-repeater-color2-control').val();
var image_url = jQuery(this).find('.custom-media-url').val();
var choice = jQuery(this).find('.customizer-repeater-image-choice').val();
var title = jQuery(this).find('.customizer-repeater-title-control').val();
var subtitle = jQuery(this).find('.customizer-repeater-subtitle-control').val();
var subtitle2 = jQuery(this).find('.customizer-repeater-subtitle2-control').val();
var btn3 = jQuery(this).find('.customizer-repeater-btn3-control').val();
var button_second = jQuery(this).find('.customizer-repeater-button2-control').val();
var align = jQuery(this).find('.customizer-repeater-align').val();
var open_new_tab = jQuery(this).find('.customizer-repeater-checkbox').attr("checked") ? 'yes' : 'no';
var id = jQuery(this).find('.social-repeater-box-id').val();
if (!id) {
id = 'social-repeater-' + abiz_customizer_repeater_uniqid();
jQuery(this).find('.social-repeater-box-id').val(id);
}
var social_repeater = jQuery(this).find('.social-repeater-socials-repeater-colector').val();
var shortcode = jQuery(this).find('.customizer-repeater-shortcode-control').val();
if (text !== '' || image_url !== '' || title !== '' || subtitle !== '' || subtitle2 !== '' || btn3 !== '' || icon_value !== '' || link !== '' || choice !== '' || social_repeater !== '' || shortcode !== '' || align !== '' || color !== '') {
values.push({
'icon_value': (choice === 'customizer_repeater_none' ? '' : icon_value),
'color': color,
'color2': color2,
'text': abizescapeHtml(text),
'link': link,
'text2': abizescapeHtml(text2),
'button_second': abizescapeHtml(button_second),
'link2': link2,
'link3': link3,
'image_url': (choice === 'customizer_repeater_none' ? '' : image_url),
'choice': choice,
'title': abizescapeHtml(title),
'subtitle': abizescapeHtml(subtitle),
'subtitle2': abizescapeHtml(subtitle2),
'btn3': abizescapeHtml(btn3),
'align': abizescapeHtml(align),
'open_new_tab' : open_new_tab,
'social_repeater': abizescapeHtml(social_repeater),
'id': id,
'shortcode': abizescapeHtml(shortcode)
});
}
});
th.find('.customizer-repeater-colector').val(JSON.stringify(values));
th.find('.customizer-repeater-colector').trigger('change');
});
}
jQuery(document).ready(function () {
'use strict';
var abiz_theme_controls = jQuery('#customize-theme-controls');
abiz_theme_controls.on('click', '.customizer-repeater-customize-control-title', function () {
jQuery(this).next().slideToggle('medium', function () {
if (jQuery(this).is(':visible')){
jQuery(this).prev().addClass('repeater-expanded');
jQuery(this).css('display', 'block');
} else {
jQuery(this).prev().removeClass('repeater-expanded');
}
});
});
abiz_theme_controls.on('change', '.icp',function(){
abiz_customizer_repeater_refresh_general_control_values();
return false;
});
abiz_theme_controls.on('change','.customizer-repeater-align', function(){
abiz_customizer_repeater_refresh_general_control_values();
return false;
});
abiz_theme_controls.on('change', '.customizer-repeater-image-choice', function () {
if (jQuery(this).val() === 'customizer_repeater_image') {
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').hide();
jQuery(this).parent().parent().find('.customizer-repeater-image-control').show();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').prev().prev().hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').hide();
}
if (jQuery(this).val() === 'customizer_repeater_icon') {
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').show();
jQuery(this).parent().parent().find('.customizer-repeater-image-control').hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').prev().prev().show();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').show();
}
if (jQuery(this).val() === 'customizer_repeater_none') {
jQuery(this).parent().parent().find('.social-repeater-general-control-icon').hide();
jQuery(this).parent().parent().find('.customizer-repeater-image-control').hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').prev().prev().hide();
jQuery(this).parent().parent().find('.customizer-repeater-color-control').hide();
}
abiz_customizer_repeater_refresh_general_control_values();
return false;
});
abiz_media_upload('.customizer-repeater-custom-media-button');
jQuery('.custom-media-url').on('change', function () {
abiz_customizer_repeater_refresh_general_control_values();
return false;
});
var color_options = {
change: function(event, ui){
abiz_customizer_repeater_refresh_general_control_values();
}
};
/**
* This adds a new box to repeater
*
*/
abiz_theme_controls.on('click', '.customizer-repeater-new-field', function () {
// Usable For Free Theme Only
var parentid = jQuery(this).parent().attr("id");
if(parentid == 'customize-control-hdr_social_icons')
{
var numItems = jQuery("#customize-control-hdr_social_icons .customizer-repeater-general-control-repeater-container").length
if(numItems >= 4){
jQuery( "#customize-control-abiz_social_icon_upgrade .flixita-upgrade-pro-message" ).show();
return false;
}
}
if(parentid == 'customize-control-footer_top_info')
{
var numItems = jQuery("#customize-control-footer_top_info .customizer-repeater-general-control-repeater-container").length
if(numItems >= 4){
jQuery( "#customize-control-abiz_footer_top_info_upgrade .flixita-upgrade-pro-message" ).show();
return false;
}
}
if(parentid == 'customize-control-slider')
{
var numItems = jQuery("#customize-control-slider .customizer-repeater-general-control-repeater-container").length
if(numItems >= 3){
jQuery( "#customize-control-abiz_slider_upgrade .flixita-upgrade-pro-message" ).show();
return false;
}
}
if(parentid == 'customize-control-info_data')
{
var numItems = jQuery("#customize-control-info_data .customizer-repeater-general-control-repeater-container").length
if(numItems >= 4){
jQuery( "#customize-control-abiz_info_upgrade .flixita-upgrade-pro-message" ).show();
return false;
}
}
if(parentid == 'customize-control-service_data')
{
var numItems = jQuery("#customize-control-service_data .customizer-repeater-general-control-repeater-container").length
if(numItems >= 4){
jQuery( "#customize-control-abiz_service_upgrade .flixita-upgrade-pro-message" ).show();
return false;
}
}
if(parentid == 'customize-control-features2_data')
{
var numItems = jQuery("#customize-control-features2_data .customizer-repeater-general-control-repeater-container").length
if(numItems >= 8){
jQuery( "#customize-control-abiz_features_upgrade .flixita-upgrade-pro-message" ).show();
return false;
}
}
var th = jQuery(this).parent();
var id = 'customizer-repeater-' + abiz_customizer_repeater_uniqid();
if (typeof th !== 'undefined') {
/* Clone the first box*/
var field = th.find('.customizer-repeater-general-control-repeater-container:first').clone( true, true );
if (typeof field !== 'undefined') {
/*Set the default value for choice between image and icon to icon*/
field.find('.customizer-repeater-image-choice').val('customizer_repeater_icon');
/*Show icon selector*/
field.find('.social-repeater-general-control-icon').show();
/*Hide image selector*/
if (field.find('.social-repeater-general-control-icon').length > 0) {
field.find('.customizer-repeater-image-control').hide();
}
/*Show delete box button because it's not the first box*/
field.find('.social-repeater-general-control-remove-field').show();
/* Empty control for icon */
field.find('.input-group-addon').find('.fa').attr('class', 'fa');
/*Remove all repeater fields except first one*/
field.find('.customizer-repeater-social-repeater').find('.customizer-repeater-social-repeater-container').not(':first').remove();
field.find('.customizer-repeater-social-repeater-link').val('');
field.find('.social-repeater-socials-repeater-colector').val('');
/*Remove value from icon field*/
field.find('.icp').val('');
/*Remove value from text field*/
field.find('.customizer-repeater-text-control').val('');
/*Remove value from link field*/
field.find('.customizer-repeater-link-control').val('');
/*Remove value from text field*/
field.find('.customizer-repeater-text2-control').val('');
/*Remove value from button field*/
field.find('.customizer-repeater-button2-control').val('');
/*Remove value from link field*/
field.find('.customizer-repeater-link2-control').val('');
/*Remove value from link field*/
field.find('.customizer-repeater-link3-control').val('');
/*Set the default value in slide align*/
field.find('.customizer-repeater-align').val('left');
/*Set the default value in checkbox*/
field.find('.customizer-repeater-checkbox').val('');
/*Set box id*/
field.find('.social-repeater-box-id').val(id);
/*Remove value from media field*/
field.find('.custom-media-url').val('');
/*Remove value from title field*/
field.find('.customizer-repeater-title-control').val('');
/*Remove value from color field*/
field.find('div.customizer-repeater-color-control .wp-picker-container').replaceWith('<input type="text" class="customizer-repeater-color-control ' + id + '">');
field.find('input.customizer-repeater-color-control').wpColorPicker(color_options);
field.find('div.customizer-repeater-color2-control .wp-picker-container').replaceWith('<input type="text" class="customizer-repeater-color2-control ' + id + '">');
field.find('input.customizer-repeater-color2-control').wpColorPicker(color_options);
// field.find('.customize-control-notifications-container').remove();
/*Remove value from subtitle field*/
field.find('.customizer-repeater-subtitle-control').val('');
/*Remove value from subtitle field*/
field.find('.customizer-repeater-subtitle2-control').val('');
/*Remove value from subtitle field*/
field.find('.customizer-repeater-btn3-control').val('');
/*Remove value from shortcode field*/
field.find('.customizer-repeater-shortcode-control').val('');
/*Append new box*/
th.find('.customizer-repeater-general-control-repeater-container:first').parent().append(field);
/*Refresh values*/
abiz_customizer_repeater_refresh_general_control_values();
}
}
return false;
});
abiz_theme_controls.on('click', '.social-repeater-general-control-remove-field', function () {
if (typeof jQuery(this).parent() !== 'undefined') {
jQuery(this).parent().hide(500, function(){
var main_social_items = jQuery("#customize-control-hdr_social_icons .customizer-repeater-general-control-repeater-container").length
if(main_social_items <= 4){
jQuery( "#customize-control-abiz_social_icon_upgrade .flixita-upgrade-pro-message" ).hide();
}
var main_footer_top_items = jQuery("#customize-control-footer_top_info .customizer-repeater-general-control-repeater-container").length
if(main_footer_top_items <= 4){
jQuery( "#customize-control-abiz_footer_top_info_upgrade .flixita-upgrade-pro-message" ).hide();
}
var main_slider_items = jQuery("#customize-control-slider .customizer-repeater-general-control-repeater-container").length
if(main_slider_items <= 3){
jQuery( "#customize-control-abiz_slider_upgrade .flixita-upgrade-pro-message" ).hide();
}
var main_info_items = jQuery("#customize-control-info_data .customizer-repeater-general-control-repeater-container").length
if(main_info_items <= 4){
jQuery( "#customize-control-abiz_info_upgrade .flixita-upgrade-pro-message" ).hide();
}
var main_service_items = jQuery("#customize-control-service_data .customizer-repeater-general-control-repeater-container").length
if(main_service_items <= 4){
jQuery( "#customize-control-abiz_service_upgrade .flixita-upgrade-pro-message" ).hide();
}
var main_features_items = jQuery("#customize-control-features2_data .customizer-repeater-general-control-repeater-container").length
if(main_features_items <= 8){
jQuery( "#customize-control-abiz_features_upgrade .flixita-upgrade-pro-message" ).hide();
}
jQuery(this).parent().remove();
abiz_customizer_repeater_refresh_general_control_values();
});
}
return false;
});
abiz_theme_controls.on('keyup', '.customizer-repeater-title-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
jQuery('input.customizer-repeater-color-control').wpColorPicker(color_options);
jQuery('input.customizer-repeater-color2-control').wpColorPicker(color_options);
abiz_theme_controls.on('keyup', '.customizer-repeater-subtitle-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-subtitle2-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-btn3-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-shortcode-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-text-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-link-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-text2-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-button2-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-link2-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('keyup', '.customizer-repeater-link3-control', function () {
abiz_customizer_repeater_refresh_general_control_values();
});
abiz_theme_controls.on('change','.customizer-repeater-checkbox', function(){
abiz_customizer_repeater_refresh_general_control_values();
});
/*Drag and drop to change icons order*/
jQuery('.customizer-repeater-general-control-droppable').sortable({
axis: 'y',
update: function () {
abiz_customizer_repeater_refresh_general_control_values();
}
});
/*----------------- Socials Repeater ---------------------*/
abiz_theme_controls.on('click', '.social-repeater-add-social-item', function (event) {
event.preventDefault();
var th = jQuery(this).parent();
var id = 'customizer-repeater-social-repeater-' + abiz_customizer_repeater_uniqid();
if (typeof th !== 'undefined') {
var field = th.find('.customizer-repeater-social-repeater-container:first').clone( true, true );
if (typeof field !== 'undefined') {
field.find( '.icp' ).val('');
field.find( '.input-group-addon' ).find('.fa').attr('class','fa');
field.find('.social-repeater-remove-social-item').show();
field.find('.customizer-repeater-social-repeater-link').val('');
field.find('.customizer-repeater-social-repeater-id').val(id);
th.find('.customizer-repeater-social-repeater-container:first').parent().append(field);
}
}
return false;
});
abiz_theme_controls.on('click', '.social-repeater-remove-social-item', function (event) {
event.preventDefault();
var th = jQuery(this).parent();
var repeater = jQuery(this).parent().parent();
th.remove();
abiz_customizer_repeater_refresh_social_icons(repeater);
return false;
});
abiz_theme_controls.on('keyup', '.customizer-repeater-social-repeater-link', function (event) {
event.preventDefault();
var repeater = jQuery(this).parent().parent();
abiz_customizer_repeater_refresh_social_icons(repeater);
return false;
});
abiz_theme_controls.on('change', '.customizer-repeater-social-repeater-container .icp', function (event) {
event.preventDefault();
var repeater = jQuery(this).parent().parent().parent();
abiz_customizer_repeater_refresh_social_icons(repeater);
return false;
});
});
var abizentityMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'\'': '&#39;',
'/': '&#x2F;'
};
function abizescapeHtml(string) {
'use strict';
//noinspection JSUnresolvedFunction
string = String(string).replace(new RegExp('\r?\n', 'g'), '<br />');
string = String(string).replace(/\\/g, '&#92;');
return String(string).replace(/[&<>"'\/]/g, function (s) {
return abizentityMap[s];
});
}

View File

@@ -0,0 +1,67 @@
(function ($) {
'use strict';
wp.abizcustomizerRepeater = {
init: function () {
$('.iconpicker-items>i').on('click', function () {
var iconClass = $(this).attr('class');
var classInput = $(this).parents('.iconpicker-popover').prev().find('.icp');
classInput.val(iconClass);
classInput.attr('value', iconClass);
var iconPreview = classInput.next('.input-group-addon');
var iconElement = '<i class="'.concat(iconClass, '"><\/i>');
iconPreview.empty();
iconPreview.append(iconElement);
var th = $(this).parent().parent().parent();
classInput.trigger('change');
abiz_customizer_repeater_refresh_social_icons(th);
return false;
});
},
search: function ($searchField) {
var itemsList = $searchField.parent().next().find('.iconpicker-items');
var searchTerm = $searchField.val().toLowerCase();
if (searchTerm.length > 0) {
itemsList.children().each(function () {
if ($(this).filter('[title*='.concat(searchTerm)).length > 0 || searchTerm.length < 1) {
$(this).show();
} else {
$(this).hide();
}
});
} else {
itemsList.children().show();
}
},
iconPickerToggle: function ($input) {
var iconPicker = $input.parent().next();
iconPicker.addClass('iconpicker-visible');
}
};
$(document).ready(function () {
wp.abizcustomizerRepeater.init();
$('.iconpicker-search').on('keyup', function () {
wp.abizcustomizerRepeater.search($(this));
});
$('.icp-auto').on('click', function () {
wp.abizcustomizerRepeater.iconPickerToggle($(this));
});
$(document).mouseup( function (e) {
var container = $('.iconpicker-popover');
if (!container.is(e.target)
&& container.has(e.target).length === 0)
{
container.removeClass('iconpicker-visible');
}
});
});
})(jQuery);

View File

@@ -0,0 +1 @@
!function(e){"use strict";wp.abizcustomizerRepeater={init:function(){e(".iconpicker-items>i").on("click",function(){var i=e(this).attr("class").slice(3),t=e(this).parents(".iconpicker-popover").prev().find(".icp");t.val(i),t.attr("value",i);var n=t.next(".input-group-addon"),c='<i class="fa '.concat(i,'"></i>');n.empty(),n.append(c);var r=e(this).parent().parent().parent();return t.trigger("change"),abiz_customizer_repeater_refresh_social_icons(r),!1})},search:function(i){var t=i.parent().next().find(".iconpicker-items"),n=i.val().toLowerCase();n.length>0?t.children().each(function(){e(this).filter("[title*=".concat(n)).length>0||n.length<1?e(this).show():e(this).hide()}):t.children().show()},iconPickerToggle:function(e){e.parent().next().addClass("iconpicker-visible")}},e(document).ready(function(){wp.abizcustomizerRepeater.init(),e(".iconpicker-search").on("keyup",function(){wp.abizcustomizerRepeater.search(e(this))}),e(".icp-auto").on("click",function(){wp.abizcustomizerRepeater.iconPickerToggle(e(this))}),e(document).mouseup(function(i){var t=e(".iconpicker-popover");t.is(i.target)||0!==t.has(i.target).length||t.removeClass("iconpicker-visible")})})}(jQuery);

View File

@@ -0,0 +1,104 @@
<?php
/**
* Abiz Theme Customizer.
*
* @package Abiz
*/
function abiz_customizer_register($wp_customize)
{
$wp_customize->get_setting('blogname')->transport = 'postMessage';
$wp_customize->get_setting('blogdescription')->transport = 'postMessage';
$wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
$wp_customize->get_setting('background_color')->transport = 'postMessage';
$wp_customize->get_setting('custom_logo')->transport = 'refresh';
/**
* Register controls
*/
$wp_customize->register_control_type('Abiz_Control_Sortable');
$wp_customize->register_control_type('Abiz_Customize_Toggle_Control');
// Control
require ABIZ_THEME_CONTROL_DIR . '/customize-base-control.php';
require ABIZ_THEME_CONTROL_DIR . '/customize-control-sortable.php';
require ABIZ_THEME_CONTROL_DIR . '/customize-category-control.php';
require ABIZ_THEME_CONTROL_DIR . '/customize-toggle-control.php';
// Sainitization
require ABIZ_THEME_CORE_DIR . '/customizer/abiz-customize-sanitization.php';
}
add_action('customize_register','abiz_customizer_register');
function abiz_customizer_script()
{
wp_enqueue_script('abiz-customizer-section', ABIZ_THEME_CORE_URI . '/customizer/assets/js/customizer-section.js', array(
"jquery"
) , '', true);
}
add_action('customize_controls_enqueue_scripts','abiz_customizer_script');
// customizer settings.
function abiz_customizer_settings()
{
/*
* Customizer Notifications
*/
require get_template_directory() . '/core/customizer/customizer-notice/abiz-customizer-notify.php';
$abiz_config_customizer = array(
'recommended_plugins' => array(
'daddy-plus' => array(
'recommended' => true,
'description' => sprintf(
/* translators: %s: plugin name */
esc_html__( 'Recommended Plugin: If you want to show all the features and business sections of the FrontPage. please install and activate %s plugin', 'abiz' ),
'<strong>Daddy Plus</strong>'
),
),
),
'recommended_actions' => array(),
'recommended_actions_title' => esc_html__( 'Recommended Actions', 'abiz' ),
'recommended_plugins_title' => esc_html__( 'Add More Features', 'abiz' ),
'install_button_label' => esc_html__( 'Install and Activate', 'abiz' ),
'activate_button_label' => esc_html__( 'Activate', 'abiz' ),
'abiz_deactivate_button_label' => esc_html__( 'Deactivate', 'abiz' ),
);
abiz_Customizer_Notify::init( apply_filters( 'abiz_customizer_notify_array', $abiz_config_customizer ) );
$settings = array(
'panels-and-sections',
'selective-refresh-and-partial',
'general'
);
foreach ($settings as $setting)
{
$feature_file = get_theme_file_path('/core/customizer/abiz-' . $setting . '.php');
require $feature_file;
}
require ABIZ_THEME_CONTROL_DIR . '/customize-upgrade-control.php';
}
add_action('after_setup_theme','abiz_customizer_settings');
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function abiz_customize_preview_js()
{
wp_enqueue_script('abiz-customizer-preview', ABIZ_THEME_CORE_URI . '/customizer/assets/js/customizer.js', array(
'customize-preview'
) , '20151215', true);
}
add_action('customize_preview_init','abiz_customize_preview_js');
//recommended plugin section function.
function abiz_recommended_plugin_section( $manager ) {
// Register custom section types.
$manager->register_section_type( 'abiz_Customize_Recommended_Plugin_Section' );
}