first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
<?php
/**
* Active callback functions.
*
* @package Water Delivery
*/
function water_delivery_featured_slider_active( $control ) {
if( $control->manager->get_setting( 'theme_options[enable_featured_slider_section]' )->value() == true ) {
return true;
}else{
return false;
}
}
function water_delivery_featured_slider_page( $control ) {
$content_type = $control->manager->get_setting( 'theme_options[featured_slider_content_type]' )->value();
return ( water_delivery_featured_slider_active( $control ) && ( 'featured_slider_page' == $content_type ) );
}
function water_delivery_featured_slider_post( $control ) {
$content_type = $control->manager->get_setting( 'theme_options[featured_slider_content_type]' )->value();
return ( water_delivery_featured_slider_active( $control ) && ( 'featured_slider_post' == $content_type ) );
}
function water_delivery_featured_services_active( $control ) {
if( $control->manager->get_setting( 'theme_options[enable_featured_services_section]' )->value() == true ) {
return true;
}else{
return false;
}
}
function water_delivery_featured_services_page( $control ) {
$content_type = $control->manager->get_setting( 'theme_options[featured_services_content_type]' )->value();
return ( water_delivery_featured_services_active( $control ) && ( 'featured_services_page' == $content_type ) );
}
function water_delivery_featured_services_post( $control ) {
$content_type = $control->manager->get_setting( 'theme_options[featured_services_content_type]' )->value();
return ( water_delivery_featured_services_active( $control ) && ( 'featured_services_post' == $content_type ) );
}
function water_delivery_featured_features_active( $control ) {
if( $control->manager->get_setting( 'theme_options[enable_featured_features_section]' )->value() == true ) {
return true;
}else{
return false;
}
}
function water_delivery_featured_features_page( $control ) {
$content_type = $control->manager->get_setting( 'theme_options[featured_features_content_type]' )->value();
return ( water_delivery_featured_features_active( $control ) && ( 'featured_features_page' == $content_type ) );
}
function water_delivery_featured_features_post( $control ) {
$content_type = $control->manager->get_setting( 'theme_options[featured_features_content_type]' )->value();
return ( water_delivery_featured_features_active( $control ) && ( 'featured_features_post' == $content_type ) );
}
function water_delivery_featured_posts_active( $control ) {
if( $control->manager->get_setting( 'theme_options[enable_featured_posts_section]' )->value() == true ) {
return true;
}else{
return false;
}
}
/**
* Active Callback for top bar section
*/
function water_delivery_contact_info_ac( $control ) {
$show_contact_info = $control->manager->get_setting( 'theme_options[show_header_contact_info]')->value();
$control_id = $control->id;
if ( $control_id == 'theme_options[header_phone]' && $show_contact_info ) return true;
return false;
}
function water_delivery_social_links_active( $control ) {
if( $control->manager->get_setting( 'theme_options[show_header_social_links]' )->value() == true ) {
return true;
}else{
return false;
}
}

View File

@@ -0,0 +1,206 @@
/**
* Custom Css for backend
*
* @package Water Delivery
*/
#water-delivery-img-container li {
padding: 3px;
}
#water-delivery-img-container .water-delivery-radio-img-selected {
border: 3px solid #dd3333;
}
/**
* Custom Css for backend
*
* Repeater Text
*
*/
.customize-control-repeater-text .repeater-text-fields .set {
margin-bottom: 5px;
padding-right: 15px;
position: relative;
}
.customize-control-repeater-text .repeater-text-fields input {
margin-bottom: 5px!important;
}
.customize-control-repeater-text .btn-remove-field {
color: red;
position: absolute;
right: -7px;
top: 3px;
}
.customize-control-repeater-text .btn-remove-field span {
text-decoration: none;
}
.customize-control-repeater-text .btn-remove-field:active,
.customize-control-repeater-text .btn-remove-field:focus {
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
}
#customize-control-theme_options-enable_frontpage_content span.customize-inside-control-row {
width: 100%;
}
#customize-control-theme_options-enable_frontpage_content label {
width: 52px;
position: relative;
}
input[type="range"] {
width: 100%;
background-color: #033b62;
-webkit-appearance: none;
height: 3px;
border-radius: 5px;
outline: none;
}
.customize-control-radio-image #water-delivery-img-container {
display: flex;
align-items: center;
}
.customize-control-title {
margin-bottom: 10px;
}
#icons-list-wrapper {
display: none;
position: fixed;
top: 0;
right: 0;
width: 100%;
height: 100%;
z-index: 3000000;
background-color: rgb(0 0 0 / 80%);
}
#icons-list-wrapper.active {
display: block !important;
}
#icons-list-wrapper .icons-list {
background-color: #fff;
padding: 30px 30px 0;
max-width: 1000px;
width: 90%;
height: 70%;
margin: auto;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
z-index: 1;
}
#icons-list-wrapper .icons-list li {
width: 89px;
height: 89px;
line-height: 110px;
text-align: center;
background: #f0f0f1;
cursor: pointer;
margin: 10px;
box-shadow: inset 0 0 15px rgb(0 0 0 / 10%), inset 0 0 0 1px rgb(0 0 0 / 5%);
}
#icons-list-wrapper .icons-list ul {
display: flex;
flex-wrap: wrap;
}
#icons-list-wrapper .icons-list li.active {
box-shadow: inset 0 0 2px 3px #fff, inset 0 0 0 7px #4f94d4;
outline: 2px solid transparent;
outline-offset: -6px;
}
#icons-list-wrapper .icons-list i {
font-size: 38px;
}
#icons-list-wrapper .save-icon,
#icons-list-wrapper .close-button {
font-size: 14px;
line-height: 28px;
padding: 5px 20px;
display: inline-block;
background: #2271b1;
border-color: #2271b1;
color: #fff;
cursor: pointer;
border-width: 1px;
border-style: solid;
border-radius: 3px;
margin-left: 10px;
}
#icons-list-wrapper .close-button {
background: #e91e63;
border-color: #e91e63;
}
#icons-list-wrapper .save-icon:hover,
#icons-list-wrapper .save-icon:focus {
background: #135e96;
border-color: #135e96;
color: #fff;
}
#icons-list-wrapper .close-button:hover,
#icons-list-wrapper .close-button:focus {
background: #da0950;
border-color: #da0950;
color: #fff;
}
#icons-list-wrapper .action-buttons {
position: sticky;
bottom: -1px;
width: 100%;
background-color: #fff;
padding: 20px 0;
}
.customize-control {
padding: 15px;
width: 88%;
background-color: #fff;
box-shadow: 0 0 10px rgb(0 0 0 / 5%);
}
.control-section .accordion-section-title,
.customize-pane-child .accordion-section-title {
padding: 14px 10px 14px 15px;
}
input[type=color],
input[type=date],
input[type=datetime-local],
input[type=datetime],
input[type=email],
input[type=month],
input[type=number],
input[type=password],
input[type=search],
input[type=tel],
input[type=text],
input[type=time],
input[type=url],
input[type=week],
select {
height: 40px;
padding: 15px;
}
textarea {
padding: 15px;
}

View File

@@ -0,0 +1,110 @@
<?php
/**
* Default theme options.
*
* @package Water Delivery
*/
if ( ! function_exists( 'water_delivery_get_default_theme_options' ) ) :
/**
* Get default theme options.
*
* @since 1.0.0
*
* @return array Default theme options.
*/
function water_delivery_get_default_theme_options() {
$defaults = array();
// Top Bar
$defaults['show_header_contact_info'] = false;
$defaults['show_header_social_links'] = false;
$defaults['header_social_links'] = array();
// Front Page Content
$defaults['enable_frontpage_content'] = true;
// Slider Section
$defaults['enable_featured_slider_section'] = false;
$defaults['featured_slider_content_type'] = 'featured_slider_page';
$defaults['featured_slider_category_readmore_text'] = esc_html__('Read More','water-delivery');
$defaults['data_slick_speed'] = 1000;
$defaults['data_slick_infinite'] = 1;
$defaults['data_slick_dots'] = 1;
$defaults['data_slick_arrows'] = 1;
$defaults['data_slick_autoplay'] = 0;
$defaults['data_slick_draggable'] = 1;
$defaults['data_slick_fade'] = 1;
$defaults['number_of_featured_slider_items'] = 6;
// Services Section
$defaults['enable_featured_services_section'] = false;
$defaults['featured_services_section_title'] = 'Services';
$defaults['number_of_featured_services_items'] = 6;
$defaults['featured_services_column'] = 'col-3';
$defaults['featured_services_content_type'] = 'featured_services_page';
// Features Section
$defaults['enable_featured_features_section'] = false;
$defaults['featured_features_section_title'] = 'Features';
$defaults['number_of_featured_features_items'] = 6;
$defaults['featured_features_column'] = 'col-4';
$defaults['featured_features_content_type'] = 'featured_features_page';
// Theme Options
$defaults['show_header_image'] = 'header-image-enable';
$defaults['show_page_title'] = 'page-title-enable';
$defaults['layout_options_blog'] = 'no-sidebar';
$defaults['layout_options_archive'] = 'no-sidebar';
$defaults['layout_options_page'] = 'no-sidebar';
$defaults['layout_options_single'] = 'right-sidebar';
$defaults['excerpt_length'] = 25;
$defaults['readmore_text'] = esc_html__('Learn More','water-delivery');
$defaults['your_latest_posts_title'] = esc_html__('Blog','water-delivery');
//Footer section
$defaults['copyright_text'] = esc_html__( 'Copyright &copy; All rights reserved.', 'water-delivery' );
// Pass through filter.
$defaults = apply_filters( 'water_delivery_filter_default_theme_options', $defaults );
return $defaults;
}
endif;
/**
* Get theme options
*/
if ( ! function_exists( 'water_delivery_get_option' ) ) :
/**
* Get theme option
*
* @since 1.0.0
*
* @param string $key Option key.
* @return mixed Option value.
*/
function water_delivery_get_option( $key ) {
$default_options = water_delivery_get_default_theme_options();
if ( empty( $key ) ) {
return;
}
$theme_options = (array)get_theme_mod( 'theme_options' );
$theme_options = wp_parse_args( $theme_options, $default_options );
$value = null;
if ( isset( $theme_options[ $key ] ) ) {
$value = $theme_options[ $key ];
}
return $value;
}
endif;

View File

@@ -0,0 +1,25 @@
<?php
/**
* Home Page Options.
*
* @package Water Delivery
*/
$default = water_delivery_get_default_theme_options();
// Add Panel.
$wp_customize->add_panel( 'home_page_panel',
array(
'title' => __( 'Homepage Sections', 'water-delivery' ),
'priority' => 130,
'capability' => 'edit_theme_options',
)
);
/**
* Section Customizer Options.
*/
require get_template_directory() . '/inc/customizer/home-sections/featured-slider.php';
require get_template_directory() . '/inc/customizer/home-sections/featured-features.php';
require get_template_directory() . '/inc/customizer/home-sections/featured-services.php';

View File

@@ -0,0 +1,193 @@
<?php
/**
* Features Section options.
*
* @package Water Delivery
*/
$default = water_delivery_get_default_theme_options();
// Features Section
$wp_customize->add_section( 'section_featured_features',
array(
'title' => __( 'Features Section', 'water-delivery' ),
'priority' => 100,
'capability' => 'edit_theme_options',
'panel' => 'home_page_panel',
)
);
// Enable Section
$wp_customize->add_setting('theme_options[enable_featured_features_section]',
array(
'default' => $default['enable_featured_features_section'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[enable_featured_features_section]',
array(
'label' => __('Enable Section', 'water-delivery'),
'section' => 'section_featured_features',
'settings' => 'theme_options[enable_featured_features_section]',
'type' => 'checkbox',
)
);
$wp_customize->add_setting( 'theme_options[featured_features_section_title]',
array(
'capability' => 'edit_theme_options',
'default' => $default['featured_features_section_title'],
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control( 'theme_options[featured_features_section_title]',
array(
'type' => 'text',
'section' => 'section_featured_features',
'label' => __( 'Section Title', 'water-delivery' ),
)
);
// Items
$wp_customize->add_setting('theme_options[number_of_featured_features_items]',
array(
'default' => $default['number_of_featured_features_items'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_number_range'
)
);
$wp_customize->add_control('theme_options[number_of_featured_features_items]',
array(
'label' => __('Items (Max: 6)', 'water-delivery'),
'section' => 'section_featured_features',
'settings' => 'theme_options[number_of_featured_features_items]',
'type' => 'number',
'active_callback' => 'water_delivery_featured_features_active',
'input_attrs' => array(
'min' => 1,
'max' => 6,
'step' => 1,
),
)
);
// Column
$wp_customize->add_setting('theme_options[featured_features_column]',
array(
'default' => $default['featured_features_column'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control(new water_delivery_Image_Radio_Control($wp_customize, 'theme_options[featured_features_column]',
array(
'label' => __('Column', 'water-delivery'),
'section' => 'section_featured_features',
'settings' => 'theme_options[featured_features_column]',
'type' => 'radio-image',
'active_callback' => 'water_delivery_featured_features_active',
'choices' => array(
'col-1' => esc_url(get_template_directory_uri()) . '/assets/images/column-1.jpg',
'col-2' => esc_url(get_template_directory_uri()) . '/assets/images/column-2.jpg',
'col-3' => esc_url(get_template_directory_uri()) . '/assets/images/column-3.jpg',
'col-4' => esc_url(get_template_directory_uri()) . '/assets/images/column-4.jpg',
'col-5' => esc_url(get_template_directory_uri()) . '/assets/images/column-5.jpg',
'col-6' => esc_url(get_template_directory_uri()) . '/assets/images/column-6.jpg',
),
))
);
// Content Type
$wp_customize->add_setting('theme_options[featured_features_content_type]',
array(
'default' => $default['featured_features_content_type'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control('theme_options[featured_features_content_type]',
array(
'label' => __('Content Type', 'water-delivery'),
'section' => 'section_featured_features',
'settings' => 'theme_options[featured_features_content_type]',
'type' => 'select',
'active_callback' => 'water_delivery_featured_features_active',
'choices' => array(
'featured_features_page' => __('Page','water-delivery'),
'featured_features_post' => __('Post','water-delivery'),
),
)
);
$number_of_featured_features_items = water_delivery_get_option( 'number_of_featured_features_items' );
for( $i=1; $i<=$number_of_featured_features_items; $i++ ) {
// Icon
$wp_customize->add_setting('theme_options[featured_features_icon_'.$i.']',
array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control('theme_options[featured_features_icon_'.$i.']',
array(
'label' => sprintf( __('Icon #%1$s', 'water-delivery'), $i),
'section' => 'section_featured_features',
'settings' => 'theme_options[featured_features_icon_'.$i.']',
'active_callback' => 'water_delivery_featured_features_active',
'type' => 'text',
)
);
// Page
$wp_customize->add_setting('theme_options[featured_features_page_'.$i.']',
array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_dropdown_pages'
)
);
$wp_customize->add_control('theme_options[featured_features_page_'.$i.']',
array(
'label' => sprintf( __('Page #%1$s', 'water-delivery'), $i),
'section' => 'section_featured_features',
'settings' => 'theme_options[featured_features_page_'.$i.']',
'type' => 'dropdown-pages',
'active_callback' => 'water_delivery_featured_features_page',
)
);
// Post
$wp_customize->add_setting('theme_options[featured_features_post_'.$i.']',
array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_dropdown_pages'
)
);
$wp_customize->add_control('theme_options[featured_features_post_'.$i.']',
array(
'label' => sprintf( __('Post #%1$s', 'water-delivery'), $i),
'section' => 'section_featured_features',
'settings' => 'theme_options[featured_features_post_'.$i.']',
'type' => 'select',
'choices' => water_delivery_dropdown_posts(),
'active_callback' => 'water_delivery_featured_features_post',
)
);
}

View File

@@ -0,0 +1,174 @@
<?php
/**
* Services Section options.
*
* @package Water Delivery
*/
$default = water_delivery_get_default_theme_options();
// Services Section
$wp_customize->add_section( 'section_featured_services',
array(
'title' => __( 'Services Section', 'water-delivery' ),
'priority' => 100,
'capability' => 'edit_theme_options',
'panel' => 'home_page_panel',
)
);
// Enable Section
$wp_customize->add_setting('theme_options[enable_featured_services_section]',
array(
'default' => $default['enable_featured_services_section'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[enable_featured_services_section]',
array(
'label' => __('Enable Section', 'water-delivery'),
'section' => 'section_featured_services',
'settings' => 'theme_options[enable_featured_services_section]',
'type' => 'checkbox',
)
);
$wp_customize->add_setting( 'theme_options[featured_services_section_title]',
array(
'capability' => 'edit_theme_options',
'default' => $default['featured_services_section_title'],
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control( 'theme_options[featured_services_section_title]',
array(
'type' => 'text',
'section' => 'section_featured_services',
'label' => __( 'Section Title', 'water-delivery'),
)
);
// Items
$wp_customize->add_setting('theme_options[number_of_featured_services_items]',
array(
'default' => $default['number_of_featured_services_items'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_number_range'
)
);
$wp_customize->add_control('theme_options[number_of_featured_services_items]',
array(
'label' => __('Items (Max: 6)', 'water-delivery'),
'section' => 'section_featured_services',
'settings' => 'theme_options[number_of_featured_services_items]',
'type' => 'number',
'active_callback' => 'water_delivery_featured_services_active',
'input_attrs' => array(
'min' => 1,
'max' => 6,
'step' => 1,
),
)
);
// Column
$wp_customize->add_setting('theme_options[featured_services_column]',
array(
'default' => $default['featured_services_column'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control(new water_delivery_Image_Radio_Control($wp_customize, 'theme_options[featured_services_column]',
array(
'label' => __('Column', 'water-delivery'),
'section' => 'section_featured_services',
'settings' => 'theme_options[featured_services_column]',
'type' => 'radio-image',
'active_callback' => 'water_delivery_featured_services_active',
'choices' => array(
'col-1' => esc_url(get_template_directory_uri()) . '/assets/images/column-1.jpg',
'col-2' => esc_url(get_template_directory_uri()) . '/assets/images/column-2.jpg',
'col-3' => esc_url(get_template_directory_uri()) . '/assets/images/column-3.jpg',
'col-4' => esc_url(get_template_directory_uri()) . '/assets/images/column-4.jpg',
'col-5' => esc_url(get_template_directory_uri()) . '/assets/images/column-5.jpg',
'col-6' => esc_url(get_template_directory_uri()) . '/assets/images/column-6.jpg',
),
))
);
// Content Type
$wp_customize->add_setting('theme_options[featured_services_content_type]',
array(
'default' => $default['featured_services_content_type'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control('theme_options[featured_services_content_type]',
array(
'label' => __('Content Type', 'water-delivery'),
'section' => 'section_featured_services',
'settings' => 'theme_options[featured_services_content_type]',
'type' => 'select',
'active_callback' => 'water_delivery_featured_services_active',
'choices' => array(
'featured_services_page' => __('Page','water-delivery'),
'featured_services_post' => __('Post','water-delivery'),
),
)
);
$number_of_featured_services_items = water_delivery_get_option( 'number_of_featured_services_items' );
for( $i=1; $i<=$number_of_featured_services_items; $i++ ) {
// Page
$wp_customize->add_setting('theme_options[featured_services_page_'.$i.']',
array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_dropdown_pages'
)
);
$wp_customize->add_control('theme_options[featured_services_page_'.$i.']',
array(
'label' => sprintf( __('Page #%1$s', 'water-delivery'), $i),
'section' => 'section_featured_services',
'settings' => 'theme_options[featured_services_page_'.$i.']',
'type' => 'dropdown-pages',
'active_callback' => 'water_delivery_featured_services_page',
)
);
// Post
$wp_customize->add_setting('theme_options[featured_services_post_'.$i.']',
array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_dropdown_pages'
)
);
$wp_customize->add_control('theme_options[featured_services_post_'.$i.']',
array(
'label' => sprintf( __('Post #%1$s', 'water-delivery'), $i),
'section' => 'section_featured_services',
'settings' => 'theme_options[featured_services_post_'.$i.']',
'type' => 'select',
'choices' => water_delivery_dropdown_posts(),
'active_callback' => 'water_delivery_featured_services_post',
)
);
}

View File

@@ -0,0 +1,275 @@
<?php
/**
* Slider options.
*
* @package Water Delivery
*/
$default = water_delivery_get_default_theme_options();
// Slider Section
$wp_customize->add_section( 'section_featured_slider',
array(
'title' => __( 'Slider Section', 'water-delivery' ),
'priority' => 100,
'capability' => 'edit_theme_options',
'panel' => 'home_page_panel',
)
);
// Enable Section
$wp_customize->add_setting('theme_options[enable_featured_slider_section]',
array(
'default' => $default['enable_featured_slider_section'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[enable_featured_slider_section]',
array(
'label' => __('Enable Section', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[enable_featured_slider_section]',
'type' => 'checkbox',
)
);
// Items
$wp_customize->add_setting('theme_options[number_of_featured_slider_items]',
array(
'default' => $default['number_of_featured_slider_items'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_number_range'
)
);
$wp_customize->add_control('theme_options[number_of_featured_slider_items]',
array(
'label' => __('Items (Max: 6)', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[number_of_featured_slider_items]',
'type' => 'number',
'active_callback' => 'water_delivery_featured_slider_active',
'input_attrs' => array(
'min' => 1,
'max' => 6,
'step' => 1,
),
)
);
// Content Type
$wp_customize->add_setting('theme_options[featured_slider_content_type]',
array(
'default' => $default['featured_slider_content_type'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control('theme_options[featured_slider_content_type]',
array(
'label' => __('Content Type', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[featured_slider_content_type]',
'type' => 'select',
'active_callback' => 'water_delivery_featured_slider_active',
'choices' => array(
'featured_slider_page' => __('Page','water-delivery'),
'featured_slider_post' => __('Post','water-delivery'),
),
)
);
$number_of_featured_slider_items = water_delivery_get_option( 'number_of_featured_slider_items' );
for( $i=1; $i<=$number_of_featured_slider_items; $i++ ) {
// Page
$wp_customize->add_setting('theme_options[featured_slider_page_'.$i.']',
array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_dropdown_pages'
)
);
$wp_customize->add_control('theme_options[featured_slider_page_'.$i.']',
array(
'label' => sprintf( __('Select Page #%1$s', 'water-delivery'), $i),
'section' => 'section_featured_slider',
'settings' => 'theme_options[featured_slider_page_'.$i.']',
'type' => 'dropdown-pages',
'active_callback' => 'water_delivery_featured_slider_page',
)
);
// Posts
$wp_customize->add_setting('theme_options[featured_slider_post_'.$i.']',
array(
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_dropdown_pages'
)
);
$wp_customize->add_control('theme_options[featured_slider_post_'.$i.']',
array(
'label' => sprintf( __('Select Post #%1$s', 'water-delivery'), $i),
'section' => 'section_featured_slider',
'settings' => 'theme_options[featured_slider_post_'.$i.']',
'type' => 'select',
'choices' => water_delivery_dropdown_posts(),
'active_callback' => 'water_delivery_featured_slider_post',
)
);
}
// Slider Speed
$wp_customize->add_setting('theme_options[data_slick_speed]',
array(
'default' => $default['data_slick_speed'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_number_range'
)
);
$wp_customize->add_control('theme_options[data_slick_speed]',
array(
'label' => __('Delay Speed (Max: 5000)', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[data_slick_speed]',
'type' => 'number',
'active_callback' => 'water_delivery_featured_slider_active',
'input_attrs' => array(
'min' => 0,
'max' => 5000,
'step' => 100,
),
)
);
// Slider Infinite
$wp_customize->add_setting('theme_options[data_slick_infinite]',
array(
'default' => $default['data_slick_infinite'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[data_slick_infinite]',
array(
'label' => __('Infinite', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[data_slick_infinite]',
'type' => 'checkbox',
'active_callback' => 'water_delivery_featured_slider_active',
)
);
// Slider Dots
$wp_customize->add_setting('theme_options[data_slick_dots]',
array(
'default' => $default['data_slick_dots'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[data_slick_dots]',
array(
'label' => __('Dots', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[data_slick_dots]',
'type' => 'checkbox',
'active_callback' => 'water_delivery_featured_slider_active',
)
);
// Slider Arrows
$wp_customize->add_setting('theme_options[data_slick_arrows]',
array(
'default' => $default['data_slick_arrows'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[data_slick_arrows]',
array(
'label' => __('Arrows', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[data_slick_arrows]',
'type' => 'checkbox',
'active_callback' => 'water_delivery_featured_slider_active',
)
);
// Slider Autoplay
$wp_customize->add_setting('theme_options[data_slick_autoplay]',
array(
'default' => $default['data_slick_autoplay'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[data_slick_autoplay]',
array(
'label' => __('Autoplay', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[data_slick_autoplay]',
'type' => 'checkbox',
'active_callback' => 'water_delivery_featured_slider_active',
)
);
// Slider Draggable
$wp_customize->add_setting('theme_options[data_slick_draggable]',
array(
'default' => $default['data_slick_draggable'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[data_slick_draggable]',
array(
'label' => __('Draggable', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[data_slick_draggable]',
'type' => 'checkbox',
'active_callback' => 'water_delivery_featured_slider_active',
)
);
// Slider Fade
$wp_customize->add_setting('theme_options[data_slick_fade]',
array(
'default' => $default['data_slick_fade'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_checkbox'
)
);
$wp_customize->add_control('theme_options[data_slick_fade]',
array(
'label' => __('Fade', 'water-delivery'),
'section' => 'section_featured_slider',
'settings' => 'theme_options[data_slick_fade]',
'type' => 'checkbox',
'active_callback' => 'water_delivery_featured_slider_active',
)
);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,42 @@
/**
* File customizer.js.
*
* Theme Customizer enhancements for a better user experience.
*
* 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 a' ).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 a, .site-description' ).css( {
'color': to
} );
}
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,249 @@
<?php
/**
* Sanitization functions.
*
* @package Water Delivery
*/
if ( ! function_exists( 'water_delivery_sanitize_select' ) ) :
/**
* Sanitize select.
*
* @since 1.0.0
*
*/
function water_delivery_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 );
}
endif;
if ( ! function_exists( 'water_delivery_dropdown_pages' ) ) :
function water_delivery_dropdown_pages( $page_id, $setting ) {
// Ensure $input is an absolute integer.
$page_id = absint( $page_id );
// If $page_id is an ID of a published page, return it; otherwise, return the default.
return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default );
}
endif;
if ( ! function_exists( 'water_delivery_dropdown_posts' ) ) :
/**
* Post Dropdown.
*
* @since 1.0.0 *
*/
function water_delivery_dropdown_posts() {
$posts = get_posts( array( 'numberposts' => -1 ) );
$choices = array();
$choices[0] = esc_html__( '--Select--', 'water-delivery' );
foreach ( $posts as $post ) {
$choices[$post->ID] = $post->post_title;
}
return $choices;
}
endif;
if ( ! function_exists( 'water_delivery_sanitize_checkbox' ) ) :
/**
* Sanitize checkbox.
*
* @since 1.0.0
*
*/
function water_delivery_sanitize_checkbox( $checked ) {
return ( ( isset( $checked ) && true === $checked ) ? true : false );
}
endif;
if ( ! function_exists( 'water_delivery_sanitize_number_range' ) ) :
/**
* Sanitize number range.
*
*/
function water_delivery_sanitize_number_range( $input, $setting ) {
// Ensure input is an absolute integer.
$input = absint( $input );
// Get the input attributes associated with the setting.
$atts = $setting->manager->get_control( $setting->id )->input_attrs;
// Get min.
$min = ( isset( $atts['min'] ) ? $atts['min'] : $input );
// Get max.
$max = ( isset( $atts['max'] ) ? $atts['max'] : $input );
// Get Step.
$step = ( isset( $atts['step'] ) ? $atts['step'] : 1 );
// If the input is within the valid range, return it; otherwise, return the default.
return ( $min <= $input && $input <= $max && is_int( $input / $step ) ? $input : $setting->default );
}
endif;
if ( ! function_exists( 'water_delivery_sanitize_textarea_content' ) ) :
/**
* Sanitize textarea content.
*
* @since 1.0.0
*
*/
function water_delivery_sanitize_textarea_content( $input, $setting ) {
return ( stripslashes( wp_filter_post_kses( addslashes( $input ) ) ) );
}
endif;
if ( ! function_exists( 'water_delivery_sanitize_positive_integer' ) ) :
/**
* Sanitize positive integer.
*
* @since 1.0.0
*
* @param int $input Number to sanitize.
* @param WP_Customize_Setting $setting WP_Customize_Setting instance.
* @return int Sanitized number; otherwise, the setting default.
*/
function water_delivery_sanitize_positive_integer( $input, $setting ) {
$input = absint( $input );
// If the input is an positive integer, return it.
// otherwise, return the default.
return ( $input ? $input : $setting->default );
}
endif;
/**
* Image sanitization callback example.
*
* Checks the image's file extension and mime type against a whitelist. If they're allowed,
* send back the filename, otherwise, return the setting default.
*
* - Sanitization: image file extension
* - Control: text, WP_Customize_Image_Control
*
* @see wp_check_filetype() https://developer.wordpress.org/reference/functions/wp_check_filetype/
*
* @param string $image Image filename.
* @param WP_Customize_Setting $setting Setting instance.
* @return string The image filename if the extension is allowed; otherwise, the setting default.
*/
function water_delivery_sanitize_image( $image, $setting ) {
/*
* Array of valid image file types.
*
* The array includes image mime types that are included in wp_get_mime_types()
*/
$mimes = array(
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'bmp' => 'image/bmp',
'tif|tiff' => 'image/tiff',
'ico' => 'image/x-icon'
);
// Return an array with file extension and mime_type.
$file = wp_check_filetype( $image, $mimes );
// If $image has a valid mime_type, return it; otherwise, return the default.
return ( $file['ext'] ? $image : $setting->default );
}
/**
* Sanitize social links.
*
* @since 1.0.0
*
* @param mixed $input The value to sanitize.
* @param WP_Customize_Setting $setting WP_Customize_Setting instance.
* @return mixed Sanitized value.
*/
function water_delivery_sanitize_social_links( $input, $setting ) {
if ( empty( $input ) ) {
return '';
}
$exploded = explode( '|', $input );
$new_array = array_map( 'esc_url_raw', $exploded );
$output = implode( '|', $new_array );
return $output;
}
if ( ! function_exists( 'water_delivery_sanitize_sortable' ) ) :
/**
* Sanitizes strings in array
* @param $input entered value
* @return sanitized output
*
* @since Water Delivery 1.0
*/
function water_delivery_sanitize_sortable( $input ) {
// Ensure $input is an array.
if ( ! is_array( $input ) )
$input = explode( ',', $input );
$output = array_map( 'sanitize_text_field', $input );
return implode( ',', $output );
}
endif;
/**
* Sanitizes email
* @param $input entered value
* @return sanitized output
*
* @since Creativ Musician 1.0
*/
function water_delivery_sanitize_array_int( $input ) {
// Ensure $input is an url.
$links = array_map( 'absint', $input );
return $links;
}
if ( ! function_exists( 'water_delivery_sanitize_phone_number' ) ) :
/**
* Sanitize Phone number.
*
* @since 1.0.0
*
*/
function water_delivery_sanitize_phone_number( $phone ) {
return preg_replace( '/[^\d+]/', '', $phone );
}
endif;

View File

@@ -0,0 +1,274 @@
<?php
/**
* Theme Options.
*
* @package Water Delivery
*/
$default = water_delivery_get_default_theme_options();
// Add Panel.
$wp_customize->add_panel( 'theme_option_panel',
array(
'title' => __( 'Theme Options', 'water-delivery' ),
'priority' => 150,
'capability' => 'edit_theme_options',
)
);
// Page Title
$wp_customize->add_section('section_page_title',
array(
'title' => __('Page Title', 'water-delivery'),
'panel' => 'theme_option_panel'
)
);
// Show / Hide Page Title
$wp_customize->add_setting( 'theme_options[show_page_title]', array(
'default' => $default['show_page_title'],
'sanitize_callback' => 'water_delivery_sanitize_select',
) );
$wp_customize->add_control( 'theme_options[show_page_title]', array(
'label' => esc_html__( 'Display Page Title', 'water-delivery' ),
'section' => 'section_page_title',
'type' => 'select',
'choices' => array(
'page-title-enable' => 'Yes',
'page-title-disable' => 'No',
),
) );
// Sidebar Layout
$wp_customize->add_section('section_sidebar_layout', array(
'title' => __('Sidebar Layout', 'water-delivery'),
'panel' => 'theme_option_panel'
));
// Blog Layout
$wp_customize->add_setting('theme_options[layout_options_blog]',
array(
'default' => $default['layout_options_blog'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control(new water_delivery_Image_Radio_Control($wp_customize, 'theme_options[layout_options_blog]',
array(
'label' => __('Blog Layout', 'water-delivery'),
'section' => 'section_sidebar_layout',
'settings' => 'theme_options[layout_options_blog]',
'type' => 'radio-image',
'choices' => array(
'left-sidebar' => get_template_directory_uri() . '/assets/images/left-sidebar.png',
'right-sidebar' => get_template_directory_uri() . '/assets/images/right-sidebar.png',
'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
),
))
);
// Archive Layout
$wp_customize->add_setting('theme_options[layout_options_archive]',
array(
'default' => $default['layout_options_archive'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control(new water_delivery_Image_Radio_Control($wp_customize, 'theme_options[layout_options_archive]',
array(
'label' => __('Archive Layout', 'water-delivery'),
'section' => 'section_sidebar_layout',
'settings' => 'theme_options[layout_options_archive]',
'type' => 'radio-image',
'choices' => array(
'left-sidebar' => get_template_directory_uri() . '/assets/images/left-sidebar.png',
'right-sidebar' => get_template_directory_uri() . '/assets/images/right-sidebar.png',
'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
),
))
);
// Page Layout
$wp_customize->add_setting('theme_options[layout_options_page]',
array(
'default' => $default['layout_options_page'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control(new water_delivery_Image_Radio_Control($wp_customize, 'theme_options[layout_options_page]',
array(
'label' => __('Page Layout', 'water-delivery'),
'section' => 'section_sidebar_layout',
'settings' => 'theme_options[layout_options_page]',
'type' => 'radio-image',
'choices' => array(
'left-sidebar' => get_template_directory_uri() . '/assets/images/left-sidebar.png',
'right-sidebar' => get_template_directory_uri() . '/assets/images/right-sidebar.png',
'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
),
))
);
// Single Post Layout
$wp_customize->add_setting('theme_options[layout_options_single]',
array(
'default' => $default['layout_options_single'],
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_select'
)
);
$wp_customize->add_control(new water_delivery_Image_Radio_Control($wp_customize, 'theme_options[layout_options_single]',
array(
'label' => __('Single Post Layout', 'water-delivery'),
'section' => 'section_sidebar_layout',
'settings' => 'theme_options[layout_options_single]',
'type' => 'radio-image',
'choices' => array(
'left-sidebar' => get_template_directory_uri() . '/assets/images/left-sidebar.png',
'right-sidebar' => get_template_directory_uri() . '/assets/images/right-sidebar.png',
'no-sidebar' => get_template_directory_uri() . '/assets/images/no-sidebar.png',
),
))
);
// Excerpt Length
$wp_customize->add_section('section_excerpt_length',
array(
'title' => __('Excerpt Length', 'water-delivery'),
'panel' => 'theme_option_panel'
)
);
$wp_customize->add_setting( 'theme_options[excerpt_length]', array(
'default' => $default['excerpt_length'],
'sanitize_callback' => 'water_delivery_sanitize_number_range',
) );
$wp_customize->add_control( 'theme_options[excerpt_length]', array(
'label' => esc_html__( 'Excerpt Length', 'water-delivery' ),
'section' => 'section_excerpt_length',
'type' => 'number',
'input_attrs' => array( 'min' => 1, 'max' => 200, 'style' => 'width: 80px;' ),
) );
// Blog Settings
$wp_customize->add_section('section_blog_setting',
array(
'title' => __('Blog / Archive Settings', 'water-delivery'),
'panel' => 'theme_option_panel'
)
);
// Blog Title
$wp_customize->add_setting( 'theme_options[your_latest_posts_title]',
array(
'default' => $default['your_latest_posts_title'],
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_textarea_content',
'transport' => 'refresh',
)
);
$wp_customize->add_control( 'theme_options[your_latest_posts_title]',
array(
'label' => __( 'Blog Title', 'water-delivery' ),
'section' => 'section_blog_setting',
'type' => 'text',
)
);
// Blog Button Label
$wp_customize->add_setting( 'theme_options[readmore_text]',
array(
'default' => $default['readmore_text'],
'capability' => 'edit_theme_options',
'sanitize_callback' => 'water_delivery_sanitize_textarea_content',
'transport' => 'refresh',
)
);
$wp_customize->add_control( 'theme_options[readmore_text]',
array(
'label' => __( 'Button Label', 'water-delivery' ),
'section' => 'section_blog_setting',
'type' => 'text',
)
);
// Footer Setting Section starts
$wp_customize->add_section('section_footer',
array(
'title' => __('Footer Setting', 'water-delivery'),
'panel' => 'theme_option_panel'
)
);
// Setting copyright_text.
$wp_customize->add_setting( 'theme_options[copyright_text]',
array(
'default' => $default['copyright_text'],
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
'transport' => 'refresh',
)
);
$wp_customize->add_control( 'theme_options[copyright_text]',
array(
'label' => __( 'Copyright Text', 'water-delivery' ),
'section' => 'section_footer',
'type' => 'text',
'priority' => 100,
)
);
// Homepage Static setting and control.
$wp_customize->add_setting( 'theme_options[enable_frontpage_content]', array(
'default' => $default['enable_frontpage_content'],
'sanitize_callback' => 'water_delivery_sanitize_checkbox',
) );
$wp_customize->add_control( 'theme_options[enable_frontpage_content]', array(
'label' => __( 'Enable Content', 'water-delivery' ),
'description' => __( 'Click to enable content on static front page only.', 'water-delivery' ),
'section' => 'static_front_page',
'type' => 'checkbox',
) );
// Show / Hide Frontpage Content
$wp_customize->add_setting( 'theme_options[enable_frontpage_content]', array(
'default' => $default['enable_frontpage_content'],
'sanitize_callback' => 'water_delivery_sanitize_checkbox',
) );
$wp_customize->add_control( 'theme_options[enable_frontpage_content]', array(
'label' => esc_html__( 'Enable Homepage Content', 'water-delivery' ),
'description' => esc_html__( 'Enable content on A static page.', 'water-delivery' ),
'section' => 'static_front_page',
'type' => 'checkbox',
) );
// Show / Hide Header Image
$wp_customize->add_setting( 'theme_options[show_header_image]', array(
'default' => $default['show_header_image'],
'sanitize_callback' => 'water_delivery_sanitize_select',
) );
$wp_customize->add_control( 'theme_options[show_header_image]', array(
'label' => esc_html__( 'Display Header Image', 'water-delivery' ),
'section' => 'header_image',
'type' => 'select',
'choices' => array(
'header-image-enable' => 'Yes',
'header-image-disable' => 'No',
),
) );

View File

@@ -0,0 +1,154 @@
<?php
$default = water_delivery_get_default_theme_options();
/**
* Add Header Top Panel
*/
$wp_customize->add_panel( 'header_top_panel', array(
'title' => __( 'Header Top', 'water-delivery' ),
'priority' => 20,
'capability' => 'edit_theme_options',
) );
/** Header contact info section */
$wp_customize->add_section(
'header_contact_info_section',
array(
'title' => __( 'Contact Info', 'water-delivery' ),
'panel' => 'header_top_panel',
'priority' => 10,
)
);
/** Header contact info control */
$wp_customize->add_setting(
'theme_options[show_header_contact_info]',
array(
'default' => $default['show_header_contact_info'],
'sanitize_callback' => 'water_delivery_sanitize_checkbox',
)
);
$wp_customize->add_control(
'theme_options[show_header_contact_info]',
array(
'label' => __( 'Show Contact Info', 'water-delivery' ),
'section' => 'header_contact_info_section',
'type' => 'checkbox',
)
);
/** Phone */
$wp_customize->add_setting( 'theme_options[header_phone]', array(
'sanitize_callback' => 'water_delivery_sanitize_phone_number',
) );
$wp_customize->add_control(
'theme_options[header_phone]',
array(
'label' => __( 'Phone', 'water-delivery' ),
'description' => __( 'Enter phone number.', 'water-delivery' ),
'section' => 'header_contact_info_section',
'active_callback' => 'water_delivery_contact_info_ac',
)
);
/** Header social links section */
$wp_customize->add_section(
'header_social_links_section',
array(
'title' => __( 'Social Links', 'water-delivery' ),
'panel' => 'header_top_panel',
'priority' => 20,
)
);
/** Header social links control */
$wp_customize->add_setting(
'theme_options[show_header_social_links]',
array(
'default' => $default['show_header_social_links'],
'sanitize_callback' => 'water_delivery_sanitize_checkbox',
)
);
$wp_customize->add_control(
'theme_options[show_header_social_links]',
array(
'label' => __( 'Show Social Links', 'water-delivery' ),
'section' => 'header_social_links_section',
'type' => 'checkbox',
)
);
// Setting social_links.
$wp_customize->add_setting(
'theme_options[social_link_1]',
array(
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
'theme_options[social_link_1]',
array(
'label' => __( 'Social Link 1', 'water-delivery' ),
'description' => __( 'Enter valid url.', 'water-delivery' ),
'section' => 'header_social_links_section',
'type' => 'url',
'active_callback' => 'water_delivery_social_links_active',
)
);
$wp_customize->add_setting(
'theme_options[social_link_2]',
array(
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
'theme_options[social_link_2]',
array(
'label' => __( 'Social Link 2', 'water-delivery' ),
'description' => __( 'Enter valid url.', 'water-delivery' ),
'section' => 'header_social_links_section',
'type' => 'url',
'active_callback' => 'water_delivery_social_links_active',
)
);
$wp_customize->add_setting(
'theme_options[social_link_3]',
array(
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
'theme_options[social_link_3]',
array(
'label' => __( 'Social Link 3', 'water-delivery' ),
'description' => __( 'Enter valid url.', 'water-delivery' ),
'section' => 'header_social_links_section',
'type' => 'url',
'active_callback' => 'water_delivery_social_links_active',
)
);
$wp_customize->add_setting(
'theme_options[social_link_4]',
array(
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
'theme_options[social_link_4]',
array(
'label' => __( 'Social Link 4', 'water-delivery' ),
'description' => __( 'Enter valid url.', 'water-delivery' ),
'section' => 'header_social_links_section',
'type' => 'url',
'active_callback' => 'water_delivery_social_links_active',
)
);