diff --git a/404.php b/404.php
index 7729e84..5796c8a 100644
--- a/404.php
+++ b/404.php
@@ -31,13 +31,15 @@
\n";
}
@@ -91,7 +91,7 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
$attributes = '';
foreach ( $atts as $attr => $value ) {
if ( ! empty( $value ) ) {
- $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
+ $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
$attributes .= ' ' . $attr . '="' . $value . '"';
}
}
@@ -99,11 +99,11 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
$item_output = $args->before;
/*
- * Glyphicons
- * ===========
- * Since the the menu item is NOT a Divider or Header we check the see
- * if there is a value in the attr_title property. If the attr_title
- * property is NOT null we apply it as the class name for the glyphicon.
+ * Glyphicons
+ * ===========
+ * Since the the menu item is NOT a Divider or Header we check the see
+ * if there is a value in the attr_title property. If the attr_title
+ * property is NOT null we apply it as the class name for the glyphicon.
*/
if ( ! empty( $item->attr_title ) ) {
if ( strpos( $item->attr_title, 'glyphicon-' ) !== false ) {
@@ -120,7 +120,6 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= ( $args->has_children ) ? ' ' : '';
-
$item_output .= $args->after;
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
diff --git a/inc/custom-header.php b/inc/custom-header.php
index 88f10e7..1a58a6c 100644
--- a/inc/custom-header.php
+++ b/inc/custom-header.php
@@ -24,17 +24,21 @@
*
*/
function sparkling_custom_header_setup() {
- add_theme_support( 'custom-header', apply_filters( 'sparkling_custom_header_args', array(
- 'default-image' => '',
- 'default-text-color' => 'dadada',
- 'width' => 300,
- 'height' => 76,
- 'flex-height' => true,
- 'flex-width' => true,
- 'wp-head-callback' => 'sparkling_header_style',
- 'admin-head-callback' => 'sparkling_admin_header_style',
- 'admin-preview-callback' => 'sparkling_admin_header_image',
- ) ) );
+ add_theme_support(
+ 'custom-header', apply_filters(
+ 'sparkling_custom_header_args', array(
+ 'default-image' => '',
+ 'default-text-color' => 'dadada',
+ 'width' => 300,
+ 'height' => 76,
+ 'flex-height' => true,
+ 'flex-width' => true,
+ 'wp-head-callback' => 'sparkling_header_style',
+ 'admin-head-callback' => 'sparkling_admin_header_style',
+ 'admin-preview-callback' => 'sparkling_admin_header_image',
+ )
+ )
+ );
}
add_action( 'after_setup_theme', 'sparkling_custom_header_setup' );
diff --git a/inc/customizer.php b/inc/customizer.php
index da8b1e8..f993d5b 100644
--- a/inc/customizer.php
+++ b/inc/customizer.php
@@ -24,251 +24,351 @@ function sparkling_customize_register( $wp_customize ) {
function sparkling_customizer( $wp_customize ) {
/* Main option Settings Panel */
- $wp_customize->add_panel( 'sparkling_main_options', array(
- 'capability' => 'edit_theme_options',
- 'theme_supports' => '',
- 'title' => __( 'Sparkling Options', 'sparkling' ),
- 'description' => __( 'Panel to update sparkling theme options', 'sparkling' ),
- // Include html tags such as .
- 'priority' => 10,
+ $wp_customize->add_panel(
+ 'sparkling_main_options', array(
+ 'capability' => 'edit_theme_options',
+ 'theme_supports' => '',
+ 'title' => __( 'Sparkling Options', 'sparkling' ),
+ 'description' => __( 'Panel to update sparkling theme options', 'sparkling' ),
+ // Include html tags such as
.
+ 'priority' => 10,
// Mixed with top-level-section hierarchy.
- ) );
+ )
+ );
// add "Content Options" section
- $wp_customize->add_section( 'sparkling_content_section', array(
- 'title' => esc_html__( 'Content Options', 'sparkling' ),
- 'priority' => 50,
- 'panel' => 'sparkling_main_options',
- ) );
+ $wp_customize->add_section(
+ 'sparkling_content_section', array(
+ 'title' => esc_html__( 'Content Options', 'sparkling' ),
+ 'priority' => 50,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
// add setting for excerpts/full posts toggle
- $wp_customize->add_setting( 'sparkling_excerpts', array(
- 'default' => 0,
- 'sanitize_callback' => 'sparkling_sanitize_checkbox',
- ) );
+ $wp_customize->add_setting(
+ 'sparkling_excerpts', array(
+ 'default' => 0,
+ 'sanitize_callback' => 'sparkling_sanitize_checkbox',
+ )
+ );
// add checkbox control for excerpts/full posts toggle
- $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'sparkling_excerpts', array(
- 'label' => esc_html__( 'Show post excerpts?', 'sparkling' ),
- 'section' => 'sparkling_content_section',
- 'priority' => 10,
- 'type' => 'epsilon-toggle',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling_page_comments', array(
- 'default' => 1,
- 'sanitize_callback' => 'sparkling_sanitize_checkbox',
- ) );
- $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'sparkling_page_comments', array(
- 'label' => esc_html__( 'Display Comments on Static Pages?', 'sparkling' ),
- 'section' => 'sparkling_content_section',
- 'priority' => 20,
- 'type' => 'epsilon-toggle',
- ) ) );
+ $wp_customize->add_control(
+ new Epsilon_Control_Toggle(
+ $wp_customize, 'sparkling_excerpts', array(
+ 'label' => esc_html__( 'Show post excerpts?', 'sparkling' ),
+ 'section' => 'sparkling_content_section',
+ 'priority' => 10,
+ 'type' => 'epsilon-toggle',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling_page_comments', array(
+ 'default' => 1,
+ 'sanitize_callback' => 'sparkling_sanitize_checkbox',
+ )
+ );
+ $wp_customize->add_control(
+ new Epsilon_Control_Toggle(
+ $wp_customize, 'sparkling_page_comments', array(
+ 'label' => esc_html__( 'Display Comments on Static Pages?', 'sparkling' ),
+ 'section' => 'sparkling_content_section',
+ 'priority' => 20,
+ 'type' => 'epsilon-toggle',
+ )
+ )
+ );
/* Sparkling Main Options */
- $wp_customize->add_section( 'sparkling_slider_options', array(
- 'title' => __( 'Slider options', 'sparkling' ),
- 'priority' => 31,
- 'panel' => 'sparkling_main_options',
- ) );
- $wp_customize->add_setting( 'sparkling[sparkling_slider_checkbox]', array(
- 'default' => 0,
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_checkbox',
- ) );
- $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'sparkling[sparkling_slider_checkbox]', array(
- 'label' => esc_html__( 'Check if you want to enable slider', 'sparkling' ),
- 'section' => 'sparkling_slider_options',
- 'priority' => 5,
- 'type' => 'epsilon-toggle',
- ) ) );
- $wp_customize->add_setting( 'sparkling[sparkling_slider_link_checkbox]', array(
- 'default' => 1,
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_checkbox',
- ) );
- $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'sparkling[sparkling_slider_link_checkbox]', array(
- 'label' => esc_html__( 'Uncheck this option to remove the link from the slides', 'sparkling' ),
- 'section' => 'sparkling_slider_options',
- 'priority' => 6,
- 'type' => 'epsilon-toggle',
- ) ) );
+ $wp_customize->add_section(
+ 'sparkling_slider_options', array(
+ 'title' => __( 'Slider options', 'sparkling' ),
+ 'priority' => 31,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[sparkling_slider_checkbox]', array(
+ 'default' => 0,
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_checkbox',
+ )
+ );
+ $wp_customize->add_control(
+ new Epsilon_Control_Toggle(
+ $wp_customize, 'sparkling[sparkling_slider_checkbox]', array(
+ 'label' => esc_html__( 'Check if you want to enable slider', 'sparkling' ),
+ 'section' => 'sparkling_slider_options',
+ 'priority' => 5,
+ 'type' => 'epsilon-toggle',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[sparkling_slider_link_checkbox]', array(
+ 'default' => 1,
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_checkbox',
+ )
+ );
+ $wp_customize->add_control(
+ new Epsilon_Control_Toggle(
+ $wp_customize, 'sparkling[sparkling_slider_link_checkbox]', array(
+ 'label' => esc_html__( 'Uncheck this option to remove the link from the slides', 'sparkling' ),
+ 'section' => 'sparkling_slider_options',
+ 'priority' => 6,
+ 'type' => 'epsilon-toggle',
+ )
+ )
+ );
// Pull all the categories into an array
global $options_categories;
- $wp_customize->add_setting( 'sparkling[sparkling_slide_categories]', array(
- 'default' => '',
- 'type' => 'option',
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sparkling_sanitize_slidecat',
- ) );
- $wp_customize->add_control( 'sparkling[sparkling_slide_categories]', array(
- 'label' => __( 'Slider Category', 'sparkling' ),
- 'section' => 'sparkling_slider_options',
- 'type' => 'select',
- 'description' => __( 'Select a category for the featured post slider', 'sparkling' ),
- 'choices' => $options_categories,
- ) );
-
- $wp_customize->add_setting( 'sparkling[sparkling_slide_number]', array(
- 'default' => 3,
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_number',
- ) );
- $wp_customize->add_control( 'sparkling[sparkling_slide_number]', array(
- 'label' => __( 'Number of slide items', 'sparkling' ),
- 'section' => 'sparkling_slider_options',
- 'description' => __( 'Enter the number of slide items', 'sparkling' ),
- 'type' => 'text',
- ) );
-
- $wp_customize->add_section( 'sparkling_layout_options', array(
- 'title' => __( 'Layout options', 'sparkling' ),
- 'priority' => 31,
- 'panel' => 'sparkling_main_options',
- ) );
+ $wp_customize->add_setting(
+ 'sparkling[sparkling_slide_categories]', array(
+ 'default' => '',
+ 'type' => 'option',
+ 'capability' => 'edit_theme_options',
+ 'sanitize_callback' => 'sparkling_sanitize_slidecat',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[sparkling_slide_categories]', array(
+ 'label' => __( 'Slider Category', 'sparkling' ),
+ 'section' => 'sparkling_slider_options',
+ 'type' => 'select',
+ 'description' => __( 'Select a category for the featured post slider', 'sparkling' ),
+ 'choices' => $options_categories,
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[sparkling_slide_number]', array(
+ 'default' => 3,
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_number',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[sparkling_slide_number]', array(
+ 'label' => __( 'Number of slide items', 'sparkling' ),
+ 'section' => 'sparkling_slider_options',
+ 'description' => __( 'Enter the number of slide items', 'sparkling' ),
+ 'type' => 'text',
+ )
+ );
+
+ $wp_customize->add_section(
+ 'sparkling_layout_options', array(
+ 'title' => __( 'Layout options', 'sparkling' ),
+ 'priority' => 31,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
// Layout options
global $site_layout;
- $wp_customize->add_setting( 'sparkling[site_layout]', array(
- 'default' => 'side-pull-left',
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_layout',
- ) );
- $wp_customize->add_control( 'sparkling[site_layout]', array(
- 'label' => __( 'Website Layout Options', 'sparkling' ),
- 'section' => 'sparkling_layout_options',
- 'type' => 'select',
- 'description' => __( 'Choose between different layout options to be used as default', 'sparkling' ),
- 'choices' => $site_layout,
- ) );
-
- if ( class_exists( 'WooCommerce' ) ) {
- $wp_customize->add_setting( 'sparkling[woo_site_layout]', array(
- 'default' => 'full-width',
+ $wp_customize->add_setting(
+ 'sparkling[site_layout]', array(
+ 'default' => 'side-pull-left',
'type' => 'option',
'sanitize_callback' => 'sparkling_sanitize_layout',
- ) );
- $wp_customize->add_control( 'sparkling[woo_site_layout]', array(
- 'label' => __( 'WooCommerce Page Layout Options', 'sparkling' ),
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[site_layout]', array(
+ 'label' => __( 'Website Layout Options', 'sparkling' ),
'section' => 'sparkling_layout_options',
'type' => 'select',
- 'description' => __( 'Choose between different layout options to be used as default for all woocommerce pages', 'sparkling' ),
+ 'description' => __( 'Choose between different layout options to be used as default', 'sparkling' ),
'choices' => $site_layout,
- ) );
+ )
+ );
+
+ if ( class_exists( 'WooCommerce' ) ) {
+ $wp_customize->add_setting(
+ 'sparkling[woo_site_layout]', array(
+ 'default' => 'full-width',
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_layout',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[woo_site_layout]', array(
+ 'label' => __( 'WooCommerce Page Layout Options', 'sparkling' ),
+ 'section' => 'sparkling_layout_options',
+ 'type' => 'select',
+ 'description' => __( 'Choose between different layout options to be used as default for all woocommerce pages', 'sparkling' ),
+ 'choices' => $site_layout,
+ )
+ );
}
- $wp_customize->add_setting( 'sparkling[element_color]', array(
- 'default' => sanitize_hex_color( '#DA4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[element_color]', array(
- 'label' => __( 'Element Color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_layout_options',
- 'settings' => 'sparkling[element_color]',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[element_color_hover]', array(
- 'default' => sanitize_hex_color( '#363636' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[element_color_hover]', array(
- 'label' => __( 'Element color on hover', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_layout_options',
- 'settings' => 'sparkling[element_color_hover]',
- ) ) );
+ $wp_customize->add_setting(
+ 'sparkling[element_color]', array(
+ 'default' => sanitize_hex_color( '#DA4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[element_color]', array(
+ 'label' => __( 'Element Color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_layout_options',
+ 'settings' => 'sparkling[element_color]',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[element_color_hover]', array(
+ 'default' => sanitize_hex_color( '#363636' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[element_color_hover]', array(
+ 'label' => __( 'Element color on hover', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_layout_options',
+ 'settings' => 'sparkling[element_color_hover]',
+ )
+ )
+ );
/* Sparkling Action Options */
- $wp_customize->add_section( 'sparkling_action_options', array(
- 'title' => __( 'Action Button', 'sparkling' ),
- 'priority' => 31,
- 'panel' => 'sparkling_main_options',
- ) );
- $wp_customize->add_setting( 'sparkling[w2f_cfa_text]', array(
- 'default' => '',
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_strip_slashes',
- ) );
- $wp_customize->add_control( 'sparkling[w2f_cfa_text]', array(
- 'label' => __( 'Call For Action Text', 'sparkling' ),
- 'description' => sprintf( __( 'Enter the text for call for action section', 'sparkling' ) ),
- 'section' => 'sparkling_action_options',
- 'type' => 'textarea',
- ) );
-
- $wp_customize->add_setting( 'sparkling[w2f_cfa_button]', array(
- 'default' => '',
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_nohtml',
- ) );
- $wp_customize->add_control( 'sparkling[w2f_cfa_button]', array(
- 'label' => __( 'Call For Action Button Title', 'sparkling' ),
- 'section' => 'sparkling_action_options',
- 'description' => __( 'Enter the title for Call For Action button', 'sparkling' ),
- 'type' => 'text',
- ) );
-
- $wp_customize->add_setting( 'sparkling[w2f_cfa_link]', array(
- 'default' => '',
- 'type' => 'option',
- 'sanitize_callback' => 'esc_url_raw',
- ) );
- $wp_customize->add_control( 'sparkling[w2f_cfa_link]', array(
- 'label' => __( 'CFA button link', 'sparkling' ),
- 'section' => 'sparkling_action_options',
- 'description' => __( 'Enter the link for Call For Action button', 'sparkling' ),
- 'type' => 'text',
- ) );
-
- $wp_customize->add_setting( 'sparkling[cfa_color]', array(
- 'default' => sanitize_hex_color( '#DA4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[cfa_color]', array(
- 'label' => __( 'Call For Action Text Color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_action_options',
- ) ) );
- $wp_customize->add_setting( 'sparkling[cfa_bg_color]', array(
- 'default' => sanitize_hex_color( '#FFF' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[cfa_bg_color]', array(
- 'label' => __( 'Call For Action Background Color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_action_options',
- ) ) );
- $wp_customize->add_setting( 'sparkling[cfa_btn_color]', array(
- 'default' => sanitize_hex_color( '#DA4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[cfa_btn_color]', array(
- 'label' => __( 'Call For Action Button Border Color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_action_options',
- ) ) );
- $wp_customize->add_setting( 'sparkling[cfa_btn_txt_color]', array(
- 'default' => sanitize_hex_color( '#DA4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[cfa_btn_txt_color]', array(
- 'label' => __( 'Call For Action Button Text Color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_action_options',
- ) ) );
+ $wp_customize->add_section(
+ 'sparkling_action_options', array(
+ 'title' => __( 'Action Button', 'sparkling' ),
+ 'priority' => 31,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[w2f_cfa_text]', array(
+ 'default' => '',
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_strip_slashes',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[w2f_cfa_text]', array(
+ 'label' => __( 'Call For Action Text', 'sparkling' ),
+ 'description' => sprintf( __( 'Enter the text for call for action section', 'sparkling' ) ),
+ 'section' => 'sparkling_action_options',
+ 'type' => 'textarea',
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[w2f_cfa_button]', array(
+ 'default' => '',
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_nohtml',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[w2f_cfa_button]', array(
+ 'label' => __( 'Call For Action Button Title', 'sparkling' ),
+ 'section' => 'sparkling_action_options',
+ 'description' => __( 'Enter the title for Call For Action button', 'sparkling' ),
+ 'type' => 'text',
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[w2f_cfa_link]', array(
+ 'default' => '',
+ 'type' => 'option',
+ 'sanitize_callback' => 'esc_url_raw',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[w2f_cfa_link]', array(
+ 'label' => __( 'CFA button link', 'sparkling' ),
+ 'section' => 'sparkling_action_options',
+ 'description' => __( 'Enter the link for Call For Action button', 'sparkling' ),
+ 'type' => 'text',
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[cfa_color]', array(
+ 'default' => sanitize_hex_color( '#DA4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[cfa_color]', array(
+ 'label' => __( 'Call For Action Text Color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_action_options',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[cfa_bg_color]', array(
+ 'default' => sanitize_hex_color( '#FFF' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[cfa_bg_color]', array(
+ 'label' => __( 'Call For Action Background Color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_action_options',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[cfa_btn_color]', array(
+ 'default' => sanitize_hex_color( '#DA4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[cfa_btn_color]', array(
+ 'label' => __( 'Call For Action Button Border Color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_action_options',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[cfa_btn_txt_color]', array(
+ 'default' => sanitize_hex_color( '#DA4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[cfa_btn_txt_color]', array(
+ 'label' => __( 'Call For Action Button Text Color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_action_options',
+ )
+ )
+ );
/* Sparkling Typography Options */
- $wp_customize->add_section( 'sparkling_typography_options', array(
- 'title' => __( 'Typography', 'sparkling' ),
- 'priority' => 31,
- 'panel' => 'sparkling_main_options',
- ) );
+ $wp_customize->add_section(
+ 'sparkling_typography_options', array(
+ 'title' => __( 'Typography', 'sparkling' ),
+ 'priority' => 31,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
// Typography Defaults
$typography_defaults = array(
'size' => '14px',
@@ -279,295 +379,441 @@ function sparkling_customizer( $wp_customize ) {
// Typography Options
global $typography_options;
- $wp_customize->add_setting( 'sparkling[main_body_typography][size]', array(
- 'default' => $typography_defaults['size'],
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_typo_size',
- ) );
- $wp_customize->add_control( 'sparkling[main_body_typography][size]', array(
- 'label' => __( 'Main Body Text', 'sparkling' ),
- 'description' => __( 'Used in p tags', 'sparkling' ),
- 'section' => 'sparkling_typography_options',
- 'type' => 'select',
- 'choices' => $typography_options['sizes'],
- ) );
- $wp_customize->add_setting( 'sparkling[main_body_typography][face]', array(
- 'default' => $typography_defaults['face'],
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_typo_face',
- ) );
- $wp_customize->add_control( 'sparkling[main_body_typography][face]', array(
- 'section' => 'sparkling_typography_options',
- 'type' => 'select',
- 'choices' => $typography_options['faces'],
- ) );
- $wp_customize->add_setting( 'sparkling[main_body_typography][style]', array(
- 'default' => $typography_defaults['style'],
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_typo_style',
- ) );
- $wp_customize->add_control( 'sparkling[main_body_typography][style]', array(
- 'section' => 'sparkling_typography_options',
- 'type' => 'select',
- 'choices' => $typography_options['styles'],
- ) );
- $wp_customize->add_setting( 'sparkling[main_body_typography][color]', array(
- 'default' => sanitize_hex_color( '#6B6B6B' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[main_body_typography][color]', array(
- 'section' => 'sparkling_typography_options',
- ) ) );
- $wp_customize->add_setting( 'sparkling[main_body_typography][subset]', array(
- 'default' => '',
- 'type' => 'option',
- 'sanitize_callback' => 'esc_html'
- ) );
- $wp_customize->add_control( 'sparkling[main_body_typography][subset]', array(
- 'label' => __( 'Font susbet', 'sparkling' ),
- 'section' => 'sparkling_typography_options',
- 'description' => __( 'Enter the Google fonts subset', 'sparkling' ),
- 'type' => 'text'
- ) );
-
- $wp_customize->add_setting( 'sparkling[heading_color]', array(
- 'default' => sanitize_hex_color( '#444' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[heading_color]', array(
- 'label' => __( 'Heading Color', 'sparkling' ),
- 'description' => __( 'Color for all headings (h1-h6)', 'sparkling' ),
- 'section' => 'sparkling_typography_options',
- ) ) );
- $wp_customize->add_setting( 'sparkling[link_color]', array(
- 'default' => sanitize_hex_color( '#DA4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[link_color]', array(
- 'label' => __( 'Link Color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_typography_options',
- ) ) );
- $wp_customize->add_setting( 'sparkling[link_hover_color]', array(
- 'default' => sanitize_hex_color( '#DADADA' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[link_hover_color]', array(
- 'label' => __( 'Link:hover Color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_typography_options',
- ) ) );
+ $wp_customize->add_setting(
+ 'sparkling[main_body_typography][size]', array(
+ 'default' => $typography_defaults['size'],
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_typo_size',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[main_body_typography][size]', array(
+ 'label' => __( 'Main Body Text', 'sparkling' ),
+ 'description' => __( 'Used in p tags', 'sparkling' ),
+ 'section' => 'sparkling_typography_options',
+ 'type' => 'select',
+ 'choices' => $typography_options['sizes'],
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[main_body_typography][face]', array(
+ 'default' => $typography_defaults['face'],
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_typo_face',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[main_body_typography][face]', array(
+ 'section' => 'sparkling_typography_options',
+ 'type' => 'select',
+ 'choices' => $typography_options['faces'],
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[main_body_typography][style]', array(
+ 'default' => $typography_defaults['style'],
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_typo_style',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[main_body_typography][style]', array(
+ 'section' => 'sparkling_typography_options',
+ 'type' => 'select',
+ 'choices' => $typography_options['styles'],
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[main_body_typography][color]', array(
+ 'default' => sanitize_hex_color( '#6B6B6B' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[main_body_typography][color]', array(
+ 'section' => 'sparkling_typography_options',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[main_body_typography][subset]', array(
+ 'default' => '',
+ 'type' => 'option',
+ 'sanitize_callback' => 'esc_html',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[main_body_typography][subset]', array(
+ 'label' => __( 'Font susbet', 'sparkling' ),
+ 'section' => 'sparkling_typography_options',
+ 'description' => __( 'Enter the Google fonts subset', 'sparkling' ),
+ 'type' => 'text',
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[heading_color]', array(
+ 'default' => sanitize_hex_color( '#444' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[heading_color]', array(
+ 'label' => __( 'Heading Color', 'sparkling' ),
+ 'description' => __( 'Color for all headings (h1-h6)', 'sparkling' ),
+ 'section' => 'sparkling_typography_options',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[link_color]', array(
+ 'default' => sanitize_hex_color( '#DA4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[link_color]', array(
+ 'label' => __( 'Link Color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_typography_options',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[link_hover_color]', array(
+ 'default' => sanitize_hex_color( '#DADADA' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[link_hover_color]', array(
+ 'label' => __( 'Link:hover Color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_typography_options',
+ )
+ )
+ );
/* Sparkling Header Options */
- $wp_customize->add_section( 'sparkling_header_options', array(
- 'title' => __( 'Header', 'sparkling' ),
- 'priority' => 31,
- 'panel' => 'sparkling_main_options',
- ) );
-
- $wp_customize->add_setting( 'sparkling[sticky_header]', array(
- 'default' => 0,
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_checkbox',
- ) );
- $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'sparkling[sticky_header]', array(
- 'label' => __( 'Sticky Header', 'sparkling' ),
- 'description' => sprintf( __( 'Check to show fixed header', 'sparkling' ) ),
- 'section' => 'sparkling_header_options',
- 'type' => 'epsilon-toggle',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[nav_bg_color]', array(
- 'default' => sanitize_hex_color( '#363636' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[nav_bg_color]', array(
- 'label' => __( 'Top nav background color', 'sparkling' ),
- 'description' => __( 'Default used if no color is selected', 'sparkling' ),
- 'section' => 'sparkling_header_options',
- ) ) );
- $wp_customize->add_setting( 'sparkling[nav_link_color]', array(
- 'default' => sanitize_hex_color( '#F5F7FA' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[nav_link_color]', array(
- 'label' => __( 'Top nav item color', 'sparkling' ),
- 'description' => __( 'Link color', 'sparkling' ),
- 'section' => 'sparkling_header_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[nav_item_hover_color]', array(
- 'default' => sanitize_hex_color( '#DA4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[nav_item_hover_color]', array(
- 'label' => __( 'Top nav item hover color', 'sparkling' ),
- 'description' => __( 'Link:hover color', 'sparkling' ),
- 'section' => 'sparkling_header_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[nav_dropdown_bg]', array(
- 'default' => sanitize_hex_color( '#da4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[nav_dropdown_bg]', array(
- 'label' => __( 'Top nav dropdown background color', 'sparkling' ),
- 'description' => __( 'Background of dropdown item hover color', 'sparkling' ),
- 'section' => 'sparkling_header_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[nav_dropdown_item]', array(
- 'default' => sanitize_hex_color( '#636467' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[nav_dropdown_item]', array(
- 'label' => __( 'Top nav dropdown item color', 'sparkling' ),
- 'description' => __( 'Dropdown item color', 'sparkling' ),
- 'section' => 'sparkling_header_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[nav_dropdown_item_hover]', array(
- 'default' => sanitize_hex_color( '#FFF' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[nav_dropdown_item_hover]', array(
- 'label' => __( 'Top nav dropdown item hover color', 'sparkling' ),
- 'description' => __( 'Dropdown item hover color', 'sparkling' ),
- 'section' => 'sparkling_header_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[nav_dropdown_bg_hover]', array(
- 'default' => sanitize_hex_color( '#DA4453' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[nav_dropdown_bg_hover]', array(
- 'label' => __( 'Top nav dropdown item background hover color', 'sparkling' ),
- 'description' => __( 'Background of dropdown item hover color', 'sparkling' ),
- 'section' => 'sparkling_header_options',
- ) ) );
+ $wp_customize->add_section(
+ 'sparkling_header_options', array(
+ 'title' => __( 'Header', 'sparkling' ),
+ 'priority' => 31,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[sticky_header]', array(
+ 'default' => 0,
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_checkbox',
+ )
+ );
+ $wp_customize->add_control(
+ new Epsilon_Control_Toggle(
+ $wp_customize, 'sparkling[sticky_header]', array(
+ 'label' => __( 'Sticky Header', 'sparkling' ),
+ 'description' => sprintf( __( 'Check to show fixed header', 'sparkling' ) ),
+ 'section' => 'sparkling_header_options',
+ 'type' => 'epsilon-toggle',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[nav_bg_color]', array(
+ 'default' => sanitize_hex_color( '#363636' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[nav_bg_color]', array(
+ 'label' => __( 'Top nav background color', 'sparkling' ),
+ 'description' => __( 'Default used if no color is selected', 'sparkling' ),
+ 'section' => 'sparkling_header_options',
+ )
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[nav_link_color]', array(
+ 'default' => sanitize_hex_color( '#F5F7FA' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[nav_link_color]', array(
+ 'label' => __( 'Top nav item color', 'sparkling' ),
+ 'description' => __( 'Link color', 'sparkling' ),
+ 'section' => 'sparkling_header_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[nav_item_hover_color]', array(
+ 'default' => sanitize_hex_color( '#DA4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[nav_item_hover_color]', array(
+ 'label' => __( 'Top nav item hover color', 'sparkling' ),
+ 'description' => __( 'Link:hover color', 'sparkling' ),
+ 'section' => 'sparkling_header_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[nav_dropdown_bg]', array(
+ 'default' => sanitize_hex_color( '#da4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[nav_dropdown_bg]', array(
+ 'label' => __( 'Top nav dropdown background color', 'sparkling' ),
+ 'description' => __( 'Background of dropdown item hover color', 'sparkling' ),
+ 'section' => 'sparkling_header_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[nav_dropdown_item]', array(
+ 'default' => sanitize_hex_color( '#636467' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[nav_dropdown_item]', array(
+ 'label' => __( 'Top nav dropdown item color', 'sparkling' ),
+ 'description' => __( 'Dropdown item color', 'sparkling' ),
+ 'section' => 'sparkling_header_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[nav_dropdown_item_hover]', array(
+ 'default' => sanitize_hex_color( '#FFF' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[nav_dropdown_item_hover]', array(
+ 'label' => __( 'Top nav dropdown item hover color', 'sparkling' ),
+ 'description' => __( 'Dropdown item hover color', 'sparkling' ),
+ 'section' => 'sparkling_header_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[nav_dropdown_bg_hover]', array(
+ 'default' => sanitize_hex_color( '#DA4453' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[nav_dropdown_bg_hover]', array(
+ 'label' => __( 'Top nav dropdown item background hover color', 'sparkling' ),
+ 'description' => __( 'Background of dropdown item hover color', 'sparkling' ),
+ 'section' => 'sparkling_header_options',
+ )
+ )
+ );
/* Sparkling Footer Options */
- $wp_customize->add_section( 'sparkling_footer_options', array(
- 'title' => __( 'Footer', 'sparkling' ),
- 'priority' => 31,
- 'panel' => 'sparkling_main_options',
- ) );
- $wp_customize->add_setting( 'sparkling[footer_widget_bg_color]', array(
- 'default' => sanitize_hex_color( '#313233' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[footer_widget_bg_color]', array(
- 'label' => __( 'Footer widget area background color', 'sparkling' ),
- 'section' => 'sparkling_footer_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[footer_bg_color]', array(
- 'default' => sanitize_hex_color( '#1F1F1F' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[footer_bg_color]', array(
- 'label' => __( 'Footer background color', 'sparkling' ),
- 'section' => 'sparkling_footer_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[footer_text_color]', array(
- 'default' => sanitize_hex_color( '#999' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[footer_text_color]', array(
- 'label' => __( 'Footer text color', 'sparkling' ),
- 'section' => 'sparkling_footer_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[footer_link_color]', array(
- 'default' => sanitize_hex_color( '#DADADA' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[footer_link_color]', array(
- 'label' => __( 'Footer link color', 'sparkling' ),
- 'section' => 'sparkling_footer_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[custom_footer_text]', array(
- 'default' => '',
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_strip_slashes',
- ) );
- $wp_customize->add_control( 'sparkling[custom_footer_text]', array(
- 'label' => __( 'Footer information', 'sparkling' ),
- 'description' => sprintf( __( 'Copyright text in footer', 'sparkling' ) ),
- 'section' => 'sparkling_footer_options',
- 'type' => 'textarea',
- ) );
+ $wp_customize->add_section(
+ 'sparkling_footer_options', array(
+ 'title' => __( 'Footer', 'sparkling' ),
+ 'priority' => 31,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[footer_widget_bg_color]', array(
+ 'default' => sanitize_hex_color( '#313233' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[footer_widget_bg_color]', array(
+ 'label' => __( 'Footer widget area background color', 'sparkling' ),
+ 'section' => 'sparkling_footer_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[footer_bg_color]', array(
+ 'default' => sanitize_hex_color( '#1F1F1F' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[footer_bg_color]', array(
+ 'label' => __( 'Footer background color', 'sparkling' ),
+ 'section' => 'sparkling_footer_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[footer_text_color]', array(
+ 'default' => sanitize_hex_color( '#999' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[footer_text_color]', array(
+ 'label' => __( 'Footer text color', 'sparkling' ),
+ 'section' => 'sparkling_footer_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[footer_link_color]', array(
+ 'default' => sanitize_hex_color( '#DADADA' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[footer_link_color]', array(
+ 'label' => __( 'Footer link color', 'sparkling' ),
+ 'section' => 'sparkling_footer_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[custom_footer_text]', array(
+ 'default' => '',
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_strip_slashes',
+ )
+ );
+ $wp_customize->add_control(
+ 'sparkling[custom_footer_text]', array(
+ 'label' => __( 'Footer information', 'sparkling' ),
+ 'description' => sprintf( __( 'Copyright text in footer', 'sparkling' ) ),
+ 'section' => 'sparkling_footer_options',
+ 'type' => 'textarea',
+ )
+ );
/* Sparkling Social Options */
- $wp_customize->add_section( 'sparkling_social_options', array(
- 'title' => __( 'Social', 'sparkling' ),
- 'priority' => 31,
- 'panel' => 'sparkling_main_options',
- ) );
- $wp_customize->add_setting( 'sparkling[social_color]', array(
- 'default' => sanitize_hex_color( '#DADADA' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[social_color]', array(
- 'label' => __( 'Social icon color', 'sparkling' ),
- 'description' => sprintf( __( 'Default used if no color is selected', 'sparkling' ) ),
- 'section' => 'sparkling_social_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[social_footer_color]', array(
- 'default' => sanitize_hex_color( '#363636' ),
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
- ) );
- $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sparkling[social_footer_color]', array(
- 'label' => __( 'Footer social icon color', 'sparkling' ),
- 'description' => sprintf( __( 'Default used if no color is selected', 'sparkling' ) ),
- 'section' => 'sparkling_social_options',
- ) ) );
-
- $wp_customize->add_setting( 'sparkling[footer_social]', array(
- 'default' => 0,
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_checkbox',
- ) );
- $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'sparkling[footer_social]', array(
- 'label' => __( 'Footer Social Icons', 'sparkling' ),
- 'description' => sprintf( __( 'Check to show social icons in footer', 'sparkling' ) ),
- 'section' => 'sparkling_social_options',
- 'type' => 'epsilon-toggle',
- ) ) );
+ $wp_customize->add_section(
+ 'sparkling_social_options', array(
+ 'title' => __( 'Social', 'sparkling' ),
+ 'priority' => 31,
+ 'panel' => 'sparkling_main_options',
+ )
+ );
+ $wp_customize->add_setting(
+ 'sparkling[social_color]', array(
+ 'default' => sanitize_hex_color( '#DADADA' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[social_color]', array(
+ 'label' => __( 'Social icon color', 'sparkling' ),
+ 'description' => sprintf( __( 'Default used if no color is selected', 'sparkling' ) ),
+ 'section' => 'sparkling_social_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[social_footer_color]', array(
+ 'default' => sanitize_hex_color( '#363636' ),
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_hexcolor',
+ )
+ );
+ $wp_customize->add_control(
+ new WP_Customize_Color_Control(
+ $wp_customize, 'sparkling[social_footer_color]', array(
+ 'label' => __( 'Footer social icon color', 'sparkling' ),
+ 'description' => sprintf( __( 'Default used if no color is selected', 'sparkling' ) ),
+ 'section' => 'sparkling_social_options',
+ )
+ )
+ );
+
+ $wp_customize->add_setting(
+ 'sparkling[footer_social]', array(
+ 'default' => 0,
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_checkbox',
+ )
+ );
+ $wp_customize->add_control(
+ new Epsilon_Control_Toggle(
+ $wp_customize, 'sparkling[footer_social]', array(
+ 'label' => __( 'Footer Social Icons', 'sparkling' ),
+ 'description' => sprintf( __( 'Check to show social icons in footer', 'sparkling' ) ),
+ 'section' => 'sparkling_social_options',
+ 'type' => 'epsilon-toggle',
+ )
+ )
+ );
/* Academicons */
- $wp_customize->add_setting( 'sparkling[academicons]', array(
- 'default' => 0,
- 'type' => 'option',
- 'sanitize_callback' => 'sparkling_sanitize_checkbox',
- ) );
-
- $wp_customize->add_control( new Epsilon_Control_Toggle( $wp_customize, 'sparkling[academicons]', array(
- 'label' => __( 'Enable Academicons', 'sparkling' ),
- 'description' => sprintf( __( 'Toggle this to ON to enable the usage of Academicons', 'sparkling' ) ),
- 'section' => 'sparkling_social_options',
- 'type' => 'epsilon-toggle',
- ) ) );
+ $wp_customize->add_setting(
+ 'sparkling[academicons]', array(
+ 'default' => 0,
+ 'type' => 'option',
+ 'sanitize_callback' => 'sparkling_sanitize_checkbox',
+ )
+ );
+
+ $wp_customize->add_control(
+ new Epsilon_Control_Toggle(
+ $wp_customize, 'sparkling[academicons]', array(
+ 'label' => __( 'Enable Academicons', 'sparkling' ),
+ 'description' => sprintf( __( 'Toggle this to ON to enable the usage of Academicons', 'sparkling' ) ),
+ 'section' => 'sparkling_social_options',
+ 'type' => 'epsilon-toggle',
+ )
+ )
+ );
}
@@ -711,11 +957,12 @@ function sparkling_customize_preview_js() {
*/
function sparkling_customizer_custom_control_css() {
?>
-
+ #customize-control-sparkling-main_body_typography-size select, #customize-control-sparkling-main_body_typography-face select, #customize-control-sparkling-main_body_typography-style select {
+ width: 60%;
+ }
+
+
-
-
+
+
'primary',
- 'theme_location' => 'primary',
- 'container' => 'div',
- 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
- 'menu_class' => 'nav navbar-nav',
- 'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
- 'walker' => new WP_Bootstrap_Navwalker(),
- ) );
+ wp_nav_menu(
+ array(
+ 'menu' => 'primary',
+ 'theme_location' => 'primary',
+ 'container' => 'div',
+ 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
+ 'menu_class' => 'nav navbar-nav',
+ 'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
+ 'walker' => new WP_Bootstrap_Navwalker(),
+ )
+ );
} /* end header menu */
endif;
@@ -135,18 +137,20 @@ function sparkling_header_menu() {
*/
function sparkling_footer_links() {
// display the WordPress Custom Menu if available
- wp_nav_menu( array(
- 'container' => '', // remove nav container
- 'container_class' => 'footer-links clearfix', // class of container (should you choose to use it)
- 'menu' => esc_html__( 'Footer Links', 'sparkling' ), // nav name
- 'menu_class' => 'nav footer-nav clearfix', // adding custom nav class
- 'theme_location' => 'footer-links', // where it's located in the theme
- 'before' => '', // before the menu
- 'after' => '', // after the menu
- 'link_before' => '', // before each link
- 'link_after' => '', // after each link
- 'fallback_cb' => 'sparkling_footer_links_fallback',// fallback function
- ) );
+ wp_nav_menu(
+ array(
+ 'container' => '', // remove nav container
+ 'container_class' => 'footer-links clearfix', // class of container (should you choose to use it)
+ 'menu' => esc_html__( 'Footer Links', 'sparkling' ), // nav name
+ 'menu_class' => 'nav footer-nav clearfix', // adding custom nav class
+ 'theme_location' => 'footer-links', // where it's located in the theme
+ 'before' => '', // before the menu
+ 'after' => '', // after the menu
+ 'link_before' => '', // before each link
+ 'link_after' => '', // after each link
+ 'fallback_cb' => 'sparkling_footer_links_fallback', // fallback function
+ )
+ );
} /* end sparkling footer link */
endif;
@@ -183,18 +187,21 @@ function sparkling_featured_slider() {
$count = of_get_option( 'sparkling_slide_number' );
$slidecat = of_get_option( 'sparkling_slide_categories' );
- $query = new WP_Query( array(
- 'cat' => $slidecat,
- 'posts_per_page' => $count,
- 'meta_query' => array(
- array(
- 'key' => '_thumbnail_id',
- 'compare' => 'EXISTS'
+ $query = new WP_Query(
+ array(
+ 'cat' => $slidecat,
+ 'posts_per_page' => $count,
+ 'meta_query' => array(
+ array(
+ 'key' => '_thumbnail_id',
+ 'compare' => 'EXISTS',
+ ),
),
- ),
- ) );
+ )
+ );
if ( $query->have_posts() ) :
- while ( $query->have_posts() ) : $query->the_post();
+ while ( $query->have_posts() ) :
+ $query->the_post();
if ( of_get_option( 'sparkling_slider_link_checkbox', 1 ) == 1 ) {
echo '
';
@@ -365,62 +372,63 @@ function get_sparkling_theme_options() {
function sparkling_options_display_sidebar() {
?>
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
- $attributes = ( ! empty( $attr['id'] ) ? ' id="' . esc_attr( $attr['id'] ) . '"' : '' );
+ $attributes = ( ! empty( $attr['id'] ) ? ' id="' . esc_attr( $attr['id'] ) . '"' : '' );
$attributes .= ' class="thumbnail wp-caption ' . esc_attr( $attr['align'] ) . '"';
$attributes .= ' style="width: ' . ( esc_attr( $attr['width'] ) + 10 ) . 'px"';
- $output = '';
+ $output = '';
$output .= do_shortcode( $content );
$output .= '' . $attr['caption'] . ' ';
$output .= ' ';
@@ -487,11 +495,13 @@ function sparkling_social() {
*/
if ( ! function_exists( 'sparkling_post_nav' ) ) {
function sparkling_post_nav() {
- the_post_navigation( array(
- 'next_text' => '%title ',
- 'prev_text' => ' %title ',
- 'in_same_term' => true,
- ) );
+ the_post_navigation(
+ array(
+ 'next_text' => '%title ',
+ 'prev_text' => ' %title ',
+ 'in_same_term' => true,
+ )
+ );
//
}
}
@@ -501,10 +511,12 @@ function sparkling_post_nav() {
*/
if ( ! function_exists( 'sparkling_paging_nav' ) ) {
function sparkling_paging_nav() {
- the_posts_pagination( array(
- 'prev_text' => ' ' . __( 'Newer posts', 'sparkling' ),
- 'next_text' => __( 'Older posts', 'sparkling' ) . ' ',
- ) );
+ the_posts_pagination(
+ array(
+ 'prev_text' => ' ' . __( 'Newer posts', 'sparkling' ),
+ 'next_text' => __( 'Older posts', 'sparkling' ) . ' ',
+ )
+ );
}
}
@@ -525,19 +537,21 @@ function sparkling_add_top_level_menu_url( $atts, $item, $args ) {
* Makes the top level navigation menu item clickable
*/
function sparkling_make_top_level_menu_clickable() {
- if ( ! wp_is_mobile() ) { ?>
-
-
+
+ 'click',
- 'container' => 'main',
- 'footer' => 'page',
- ) );
+ add_theme_support(
+ 'infinite-scroll', array(
+ 'type' => 'click',
+ 'container' => 'main',
+ 'footer' => 'page',
+ )
+ );
}
add_action( 'after_setup_theme', 'sparkling_jetpack_setup' );
diff --git a/inc/metaboxes.php b/inc/metaboxes.php
index d3b0b14..d4ac9e9 100644
--- a/inc/metaboxes.php
+++ b/inc/metaboxes.php
@@ -11,19 +11,22 @@
* Add Meta box in page and post post types.
*/
function sparkling_add_custom_box() {
- add_meta_box('siderbar-layout', //Unique ID
+ add_meta_box(
+ 'siderbar-layout', //Unique ID
__( 'Select layout for this specific Page only ( Note: This setting only reflects if page Template is set as Default Template and Blog Type Templates.)', 'sparkling' ), //Title
'sparkling_sidebar_layout', //Callback function
'page' //show metabox in pages
);
- add_meta_box('siderbar-layout', //Unique ID
+ add_meta_box(
+ 'siderbar-layout', //Unique ID
__( 'Select layout for this specific Post only', 'sparkling' ), //Title
'sparkling_sidebar_layout', //Callback function
'post', //show metabox in posts
'side'
);
if ( class_exists( 'WooCommerce' ) ) {
- add_meta_box('product-siderbar-layout', //Unique ID
+ add_meta_box(
+ 'product-siderbar-layout', //Unique ID
__( 'Select layout for this specific Product only', 'sparkling' ), //Title
'sparkling_sidebar_layout', //Callback function
'product', //show metabox in posts
@@ -49,18 +52,25 @@ function sparkling_sidebar_layout() {
+ %1$s %2$s ',
- sprintf( '%2$s ',
+ printf(
+ ' %1$s %2$s ',
+ sprintf(
+ '%2$s ',
esc_url( get_permalink() ),
$time_string
),
- sprintf( '%2$s ',
+ sprintf(
+ '%2$s ',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
)
@@ -70,12 +74,14 @@ function sparkling_categorized_blog() {
$all_the_cool_cats = get_transient( 'sparkling_categories' );
if ( false === $all_the_cool_cats ) {
// Create an array of all the categories that are attached to posts.
- $all_the_cool_cats = get_categories( array(
- 'fields' => 'ids',
- 'hide_empty' => 1,
- // We only need to know if there is more than one category.
- 'number' => 2,
- ) );
+ $all_the_cool_cats = get_categories(
+ array(
+ 'fields' => 'ids',
+ 'hide_empty' => 1,
+ // We only need to know if there is more than one category.
+ 'number' => 2,
+ )
+ );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'sparkling_categories', $all_the_cool_cats );
@@ -99,4 +105,4 @@ function sparkling_category_transient_flusher() {
delete_transient( 'sparkling_categories' );
}
add_action( 'edit_category', 'sparkling_category_transient_flusher' );
-add_action( 'save_post', 'sparkling_category_transient_flusher' );
+add_action( 'save_post', 'sparkling_category_transient_flusher' );
diff --git a/inc/welcome-screen/class-sparkling-notify-system.php b/inc/welcome-screen/class-sparkling-notify-system.php
index 05c97ba..7f1af08 100644
--- a/inc/welcome-screen/class-sparkling-notify-system.php
+++ b/inc/welcome-screen/class-sparkling-notify-system.php
@@ -148,7 +148,7 @@ public static function has_import_plugin( $slug = null ) {
public static function has_import_content() {
- $plugin = self::has_import_plugin( 'wordpress-importer' );
+ $plugin = self::has_import_plugin( 'wordpress-importer' );
$content = self::has_posts();
if ( ! $plugin || ! $content ) {
return false;
@@ -162,11 +162,11 @@ public static function has_import_plugins() {
$check = array(
'wordpress-importer' => array(
'installed' => false,
- 'active' => false,
+ 'active' => false,
),
'widget-importer-exporter' => array(
'installed' => false,
- 'active' => false,
+ 'active' => false,
),
);
@@ -262,9 +262,9 @@ public static function create_plugin_requirement_title( $install_text, $activate
if ( '' == $install_text && '' == $activate_text ) {
return;
}
- if ( '' == $install_text && '' == $activate_text ) {
+ if ( '' == $install_text && '' == $activate_text ) {
$install_text = $activate_text;
- } elseif ( '' == $activate_text && '' == $install_text ) {
+ } elseif ( '' == $activate_text && '' == $install_text ) {
$activate_text = $install_text;
}
diff --git a/inc/welcome-screen/class-sparkling-welcome.php b/inc/welcome-screen/class-sparkling-welcome.php
index a074d60..73a7633 100644
--- a/inc/welcome-screen/class-sparkling-welcome.php
+++ b/inc/welcome-screen/class-sparkling-welcome.php
@@ -19,20 +19,26 @@ public function __construct() {
add_action( 'admin_enqueue_scripts', array( $this, 'sparkling_welcome_style_and_scripts' ) );
/* ajax callback for dismissable required actions */
- add_action( 'wp_ajax_sparkling_dismiss_required_action', array(
- $this,
- 'sparkling_dismiss_required_action_callback',
- ) );
+ add_action(
+ 'wp_ajax_sparkling_dismiss_required_action', array(
+ $this,
+ 'sparkling_dismiss_required_action_callback',
+ )
+ );
- add_action( 'wp_ajax_sparkling_dismiss_recommended_plugins', array(
- $this,
- 'sparkling_dismiss_recommended_plugins_callback',
- ) );
+ add_action(
+ 'wp_ajax_sparkling_dismiss_recommended_plugins', array(
+ $this,
+ 'sparkling_dismiss_recommended_plugins_callback',
+ )
+ );
- add_action( 'wp_ajax_sparkling_sparkling_set_frontpage', array(
- $this,
- 'sparkling_set_pages',
- ) );
+ add_action(
+ 'wp_ajax_sparkling_sparkling_set_frontpage', array(
+ $this,
+ 'sparkling_set_pages',
+ )
+ );
add_action( 'admin_init', array( $this, 'sparkling_activate_plugin' ) );
add_action( 'admin_init', array( $this, 'sparkling_deactivate_plugin' ) );
@@ -45,7 +51,7 @@ public function sparkling_set_pages() {
* Check action
*/
if ( ! empty( $_GET['action'] ) && 'sparkling_set_frontpage' === $_GET['action'] ) {
- $about = get_page_by_title( 'Homepage' );
+ $about = get_page_by_title( 'Homepage' );
update_option( 'page_on_front', $about->ID );
update_option( 'show_on_front', 'page' );
@@ -101,10 +107,12 @@ public function sparkling_welcome_register_menu() {
$action_count = $this->count_actions();
$title = $action_count > 0 ? 'About Sparkling ' . esc_html( $action_count ) . ' ' : 'About Sparkling';
- add_theme_page( 'About Sparkling', $title, 'edit_theme_options', 'sparkling-welcome', array(
- $this,
- 'sparkling_welcome_screen',
- ) );
+ add_theme_page(
+ 'About Sparkling', $title, 'edit_theme_options', 'sparkling-welcome', array(
+ $this,
+ 'sparkling_welcome_screen',
+ )
+ );
}
/**
@@ -149,12 +157,14 @@ public function sparkling_welcome_style_and_scripts( $hook_suffix ) {
if ( 'customize' != $screen->base ) {
wp_enqueue_script( 'sparkling-welcome-screen-js', get_template_directory_uri() . '/inc/welcome-screen/js/welcome.js', array( 'jquery' ), '1.0', true );
- wp_localize_script( 'sparkling-welcome-screen-js', 'sparklingWelcomeScreenObject', array(
- 'nr_actions_required' => $this->count_actions(),
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
- 'template_directory' => get_template_directory_uri(),
- 'no_required_actions_text' => __( 'Hooray! There are no required actions for you right now.', 'sparkling' ),
- ) );
+ wp_localize_script(
+ 'sparkling-welcome-screen-js', 'sparklingWelcomeScreenObject', array(
+ 'nr_actions_required' => $this->count_actions(),
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
+ 'template_directory' => get_template_directory_uri(),
+ 'no_required_actions_text' => __( 'Hooray! There are no required actions for you right now.', 'sparkling' ),
+ )
+ );
}
}
@@ -256,26 +266,28 @@ public function call_plugin_api( $slug ) {
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
$call_api = get_transient( 'sparkling_plugin_information_transient_' . $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' => true,
- 'homepage' => true,
- 'added' => false,
- 'last_updated' => false,
- 'compatibility' => false,
- 'tested' => false,
- 'requires' => false,
- 'downloadlink' => false,
- 'icons' => true,
- ),
- ) );
+ $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' => true,
+ 'homepage' => true,
+ 'added' => false,
+ 'last_updated' => false,
+ 'compatibility' => false,
+ 'tested' => false,
+ 'requires' => false,
+ 'downloadlink' => false,
+ 'icons' => true,
+ ),
+ )
+ );
set_transient( 'sparkling_plugin_information_transient_' . $slug, $call_api, 30 * MINUTE_IN_SECONDS );
}
@@ -290,13 +302,13 @@ public function check_active( $slug ) {
return array(
'status' => is_plugin_active( $slug . '/' . $slug . '.php' ),
- 'needs' => $needs,
+ 'needs' => $needs,
);
}
return array(
'status' => false,
- 'needs' => 'install',
+ 'needs' => 'install',
);
}
@@ -329,22 +341,26 @@ public function create_action_link( $state, $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' ) );
+ 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' ) );
+ 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;
}
}
@@ -359,7 +375,7 @@ public function sparkling_welcome_screen() {
require_once( ABSPATH . 'wp-admin/admin.php' );
require_once( ABSPATH . 'wp-admin/admin-header.php' );
- $sparkling = wp_get_theme();
+ $sparkling = wp_get_theme();
$active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'getting_started';
$action_count = $this->count_actions();
diff --git a/inc/welcome-screen/sections/actions-required.php b/inc/welcome-screen/sections/actions-required.php
index 94f14ba..f220dec 100644
--- a/inc/welcome-screen/sections/actions-required.php
+++ b/inc/welcome-screen/sections/actions-required.php
@@ -13,8 +13,8 @@
global $sparkling_required_actions, $sparkling_recommended_plugins;
if ( ! empty( $sparkling_required_actions ) ) :
/* sparkling_show_required_actions is an array of true/false for each required action that was dismissed */
- $nr_actions_required = 0;
- $nr_action_dismissed = 0;
+ $nr_actions_required = 0;
+ $nr_action_dismissed = 0;
$sparkling_show_required_actions = get_option( 'sparkling_show_required_actions' );
foreach ( $sparkling_required_actions as $sparkling_required_action_key => $sparkling_required_action_value ) :
$hidden = false;
@@ -38,13 +38,24 @@
-
+
+
+
-
- ' . $sparkling_required_action_value['help'];
-endif; ?>
+
+ ' . $sparkling_required_action_value['help'];
+endif;
+?>
-
-
+
+ href="">
"
$nr_recommended_plugins ++;
echo '';
- if ( isset( $sparkling_show_recommended_plugins[ $slug ] ) && $sparkling_show_recommended_plugins[ $slug ] ) : ?>
+ if ( isset( $sparkling_show_recommended_plugins[ $slug ] ) && $sparkling_show_recommended_plugins[ $slug ] ) :
+ ?>
- check_active( $slug );
$url = $this->create_action_link( $active['needs'], $slug );
$info = $this->call_plugin_api( $slug );
$label = '';
- $class = '';
+ $class = '';
switch ( $active['needs'] ) {
case 'install':
$class = 'install-now button';
@@ -126,14 +139,14 @@ class=""
break;
}
?>
-
name ?>
+
name; ?>
- short_description ?>
+ short_description; ?>
-
-
+
+ href="">
count_actions();
+$count = $this->count_actions();
?>
@@ -16,13 +16,15 @@
-
+
+
-
+
diff --git a/inc/welcome-screen/sections/recommended-plugins.php b/inc/welcome-screen/sections/recommended-plugins.php
index 5f9f4fa..477e249 100644
--- a/inc/welcome-screen/sections/recommended-plugins.php
+++ b/inc/welcome-screen/sections/recommended-plugins.php
@@ -35,21 +35,22 @@
?>
-
-
version ?>
+
+
version; ?>
| author ) ?>
+ class="separator">| author ); ?>
+ class="action_bar ">
name; ?>
+ class="plugin_name">name; ?>
-
+ class="plugin-card- action_button ">
+
-
diff --git a/inc/welcome-screen/sections/support.php b/inc/welcome-screen/sections/support.php
index bd8f4b2..1ad690f 100644
--- a/inc/welcome-screen/sections/support.php
+++ b/inc/welcome-screen/sections/support.php
@@ -4,7 +4,7 @@
-
+
@@ -14,7 +14,7 @@
-
+
@@ -24,7 +24,7 @@
-
+
diff --git a/inc/welcome-screen/welcome-page-setup.php b/inc/welcome-screen/welcome-page-setup.php
index 54009f7..d064f2c 100644
--- a/inc/welcome-screen/welcome-page-setup.php
+++ b/inc/welcome-screen/welcome-page-setup.php
@@ -60,10 +60,12 @@ function sparkling_welcome_scripts_for_customizer() {
wp_add_inline_script( 'plugin-install', 'var pagenow = "customizer";' );
wp_enqueue_script( 'sparkling-welcome-screen-customizer-js', get_template_directory_uri() . '/inc/welcome-screen/js/welcome_customizer.js', array( 'customize-controls' ), '1.0', true );
- wp_localize_script( 'sparkling-welcome-screen-customizer-js', 'sparklingWelcomeScreenObject', array(
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
- 'template_directory' => get_template_directory_uri(),
- ) );
+ wp_localize_script(
+ 'sparkling-welcome-screen-customizer-js', 'sparklingWelcomeScreenObject', array(
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
+ 'template_directory' => get_template_directory_uri(),
+ )
+ );
}
@@ -77,10 +79,10 @@ function sparkling_welcome_scripts_for_customizer() {
'colorlib-login-customizer' => array(
'recommended' => true,
),
- 'fancybox-for-wordpress' => array(
+ 'fancybox-for-wordpress' => array(
'recommended' => false,
),
- 'simple-custom-post-order' => array(
+ 'simple-custom-post-order' => array(
'recommended' => true,
),
diff --git a/inc/widgets/class-sparkling-categories.php b/inc/widgets/class-sparkling-categories.php
index 150cf22..a8fae6b 100644
--- a/inc/widgets/class-sparkling-categories.php
+++ b/inc/widgets/class-sparkling-categories.php
@@ -9,20 +9,20 @@ class Sparkling_Categories extends WP_Widget {
function __construct() {
$widget_ops = array(
- 'classname' => 'sparkling-cats',
- 'description' => esc_html__( 'Sparkling Categories' ,'sparkling' ),
+ 'classname' => 'sparkling-cats',
+ 'description' => esc_html__( 'Sparkling Categories', 'sparkling' ),
);
- parent::__construct( 'sparkling-cats', esc_html__( 'Sparkling Categories','sparkling' ), $widget_ops );
+ parent::__construct( 'sparkling-cats', esc_html__( 'Sparkling Categories', 'sparkling' ), $widget_ops );
}
function widget( $args, $instance ) {
- $title = isset( $instance['title'] ) ? $instance['title'] : esc_html__( 'Categories' , 'sparkling' );
+ $title = isset( $instance['title'] ) ? $instance['title'] : esc_html__( 'Categories', 'sparkling' );
$enable_count = '';
if ( isset( $instance['enable_count'] ) ) {
$enable_count = $instance['enable_count'] ? $instance['enable_count'] : 'checked';
}
- $limit = ($instance['limit']) ? $instance['limit'] : 4;
+ $limit = ( $instance['limit'] ) ? $instance['limit'] : 4;
echo $args['before_widget'];
echo $args['before_title'];
@@ -38,32 +38,35 @@ function widget( $args, $instance ) {
@@ -75,7 +78,7 @@ function widget( $args, $instance ) {
function form( $instance ) {
if ( ! isset( $instance['title'] ) ) {
- $instance['title'] = esc_html__( 'Categories' , 'sparkling' );
+ $instance['title'] = esc_html__( 'Categories', 'sparkling' );
}
if ( ! isset( $instance['limit'] ) ) {
$instance['limit'] = 4;
@@ -86,7 +89,7 @@ function form( $instance ) {
?>
-
+
-
+
+ id="get_field_id( 'enable_count' ); ?>"
+
/>
-
+
'sparkling-popular-posts',
+ 'classname' => 'sparkling-popular-posts',
'description' => esc_html__( 'Sparkling Popular Posts Widget', 'sparkling' ),
);
- parent::__construct( 'sparkling_popular_posts', esc_html__( 'Sparkling Popular Posts Widget','sparkling' ), $widget_ops );
+ parent::__construct( 'sparkling_popular_posts', esc_html__( 'Sparkling Popular Posts Widget', 'sparkling' ), $widget_ops );
}
public function enqueue() {
@@ -28,8 +28,8 @@ public function enqueue() {
}
function widget( $args, $instance ) {
- $title = isset( $instance['title'] ) ? $instance['title'] : esc_html__( 'Popular Posts', 'sparkling' );
- $limit = isset( $instance['limit'] ) ? $instance['limit'] : 5;
+ $title = isset( $instance['title'] ) ? $instance['title'] : esc_html__( 'Popular Posts', 'sparkling' );
+ $limit = isset( $instance['limit'] ) ? $instance['limit'] : 5;
$default_image = isset( $instance['default_image'] ) ? $instance['default_image'] : '';
echo $args['before_widget'];
@@ -48,9 +48,9 @@ function widget( $args, $instance ) {
$limit,
- 'orderby' => 'comment_count',
- 'order' => 'DESC',
+ 'posts_per_page' => $limit,
+ 'orderby' => 'comment_count',
+ 'order' => 'DESC',
'ignore_sticky_posts' => 1,
);
@@ -59,11 +59,13 @@ function widget( $args, $instance ) {
/**
* Check if zilla likes plugin exists
*/
- if ( $featured_query->have_posts() ) : while ( $featured_query->have_posts() ) : $featured_query->the_post();
+ if ( $featured_query->have_posts() ) :
+ while ( $featured_query->have_posts() ) :
+ $featured_query->the_post();
- ?>
+ ?>
-
+
@@ -74,8 +76,8 @@ function widget( $args, $instance ) {
@@ -87,7 +89,7 @@ function widget( $args, $instance ) {
@@ -95,7 +97,7 @@ function widget( $args, $instance ) {
-
-
+
-
-
+
-
+
-
-
-
-
+
-
+
diff --git a/template-parts/content-video.php b/template-parts/content-video.php
index 56f1bfd..918fb72 100644
--- a/template-parts/content-video.php
+++ b/template-parts/content-video.php
@@ -9,25 +9,25 @@
';
- echo $video_html;
- echo '
';
- }
- }elseif ( has_post_thumbnail() ) {
- $thumbnail_args = array(
- 'class' => 'single-featured',
- );
- $title_args = array(
- 'echo' => false,
- );
- echo '
';
- the_post_thumbnail( 'sparkling-featured-fullwidth', $thumbnail_args);
- echo ' ';
+ if ( ! empty( $video ) ) {
+ foreach ( $video as $video_html ) {
+ echo '
';
+ echo $video_html;
+ echo '
';
}
+ } elseif ( has_post_thumbnail() ) {
+ $thumbnail_args = array(
+ 'class' => 'single-featured',
+ );
+ $title_args = array(
+ 'echo' => false,
+ );
+ echo '
';
+ the_post_thumbnail( 'sparkling-featured-fullwidth', $thumbnail_args );
+ echo ' ';
+ }
?>
@@ -38,7 +38,7 @@
-
+
@@ -49,7 +49,7 @@
esc_html__( 'Edit %s', 'sparkling' ),
the_title( '
"', '" ', false )
),
- '
',
+ '',
' '
);
?>
@@ -69,22 +69,26 @@
+ the_excerpt();
+ ?>
-
'' . esc_html__( 'Pages:', 'sparkling' ),
- 'after' => '
',
- 'link_before' => '',
- 'link_after' => ' ',
- 'pagelink' => '%',
- 'echo' => 1,
- ) );
+ wp_link_pages(
+ array(
+ 'before' => '' . esc_html__( 'Pages:', 'sparkling' ),
+ 'after' => '
',
+ 'link_before' => '',
+ 'link_after' => ' ',
+ 'pagelink' => '%',
+ 'echo' => 1,
+ )
+ );
?>
diff --git a/template-parts/content.php b/template-parts/content.php
index 3ef77c4..083a648 100644
--- a/template-parts/content.php
+++ b/template-parts/content.php
@@ -9,12 +9,17 @@
'single-featured',
- ) );
- } else { the_post_thumbnail( 'sparkling-featured', array(
- 'class' => 'single-featured',
- ) );
+ the_post_thumbnail(
+ 'sparkling-featured-fullwidth', array(
+ 'class' => 'single-featured',
+ )
+ );
+ } else {
+ the_post_thumbnail(
+ 'sparkling-featured', array(
+ 'class' => 'single-featured',
+ )
+ );
}
?>
@@ -26,7 +31,7 @@
-
+
@@ -37,7 +42,7 @@
esc_html__( 'Edit %s', 'sparkling' ),
the_title( '
"', '" ', false )
),
- '
',
+ '',
' '
);
?>
@@ -57,22 +62,26 @@
+ the_excerpt();
+ ?>
-
'' . esc_html__( 'Pages:', 'sparkling' ),
- 'after' => '
',
- 'link_before' => '',
- 'link_after' => ' ',
- 'pagelink' => '%',
- 'echo' => 1,
- ) );
+ wp_link_pages(
+ array(
+ 'before' => '' . esc_html__( 'Pages:', 'sparkling' ),
+ 'after' => '
',
+ 'link_before' => '',
+ 'link_after' => ' ',
+ 'pagelink' => '%',
+ 'echo' => 1,
+ )
+ );
?>