Initial commit
This commit is contained in:
1554
wp-content/plugins/gp-premium/colors/functions/functions.php
Normal file
1554
wp-content/plugins/gp-premium/colors/functions/functions.php
Normal file
File diff suppressed because it is too large
Load Diff
613
wp-content/plugins/gp-premium/colors/functions/js/customizer.js
Normal file
613
wp-content/plugins/gp-premium/colors/functions/js/customizer.js
Normal file
@ -0,0 +1,613 @@
|
||||
/**
|
||||
* Theme Customizer enhancements for a better user experience.
|
||||
*
|
||||
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
||||
*/
|
||||
function generate_colors_live_update( id, selector, property, default_value, get_value, settings ) {
|
||||
default_value = typeof default_value !== 'undefined' ? default_value : 'initial';
|
||||
get_value = typeof get_value !== 'undefined' ? get_value : '';
|
||||
settings = typeof settings !== 'undefined' ? settings : 'generate_settings';
|
||||
wp.customize( settings + '[' + id + ']', function( value ) {
|
||||
value.bind( function( newval ) {
|
||||
|
||||
// Stop the header link color from applying to the site title.
|
||||
if ( 'header_link_color' === id || 'header_link_color' === id ) {
|
||||
jQuery( '.site-header a' ).addClass( 'header-link' );
|
||||
jQuery( '.site-header .main-title a' ).removeClass( 'header-link' );
|
||||
}
|
||||
|
||||
if ( 'content_link_color' === id || 'content_link_color_hover' === id || 'entry_meta_link_color' === id || 'blog_post_title_color' === id ) {
|
||||
var content_link = jQuery( '.inside-article a' );
|
||||
var meta = jQuery( '.entry-meta a' );
|
||||
var title = jQuery( '.entry-title a' );
|
||||
|
||||
content_link.attr( 'data-content-link-color', true );
|
||||
|
||||
if ( '' !== wp.customize.value('generate_settings[entry_meta_link_color]')() ) {
|
||||
meta.attr( 'data-content-link-color', '' );
|
||||
} else {
|
||||
meta.attr( 'data-content-link-color', true );
|
||||
}
|
||||
|
||||
if ( '' !== wp.customize.value('generate_settings[blog_post_title_color]')() ) {
|
||||
title.attr( 'data-content-link-color', '' );
|
||||
} else {
|
||||
title.attr( 'data-content-link-color', true );
|
||||
}
|
||||
}
|
||||
|
||||
default_value = ( '' !== get_value ) ? wp.customize.value('generate_settings[' + get_value + ']')() : default_value;
|
||||
newval = ( '' !== newval ) ? newval : default_value;
|
||||
var unique_id = ( 'generate_secondary_nav_settings' == settings ) ? 'secondary_' : '';
|
||||
if ( jQuery( 'style#' + unique_id + id ).length ) {
|
||||
jQuery( 'style#' + unique_id + id ).html( selector + '{' + property + ':' + newval + ';}' );
|
||||
} else {
|
||||
jQuery( 'head' ).append( '<style id="' + unique_id + id + '">' + selector + '{' + property + ':' + newval + '}</style>' );
|
||||
setTimeout(function() {
|
||||
jQuery( 'style#' + id ).not( ':last' ).remove();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* Header background color
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'top_bar_background_color', '.top-bar', 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Header text color
|
||||
* Empty: text_color
|
||||
*/
|
||||
generate_colors_live_update( 'top_bar_text_color', '.top-bar', 'color', '', 'text_color' );
|
||||
|
||||
/**
|
||||
* Header link color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'top_bar_link_color', '.top-bar a, .top-bar a:visited', 'color', '', 'link_color' );
|
||||
|
||||
/**
|
||||
* Header link color hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'top_bar_link_color_hover', '.top-bar a:hover', 'color', '', 'link_color_hover' );
|
||||
|
||||
|
||||
/**
|
||||
* Header background color
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'header_background_color', '.site-header', 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Header text color
|
||||
* Empty: text_color
|
||||
*/
|
||||
generate_colors_live_update( 'header_text_color', '.site-header', 'color', '', 'text_color' );
|
||||
|
||||
/**
|
||||
* Header link color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'header_link_color', '.site-header a.header-link, .site-header a.header-link:visited', 'color', '', 'link_color' );
|
||||
|
||||
/**
|
||||
* Header link color hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'header_link_hover_color', '.site-header a.header-link:hover', 'color', '', 'link_color_hover' );
|
||||
|
||||
/**
|
||||
* Site title color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'site_title_color', '.main-title a,.main-title a:hover,.main-title a:visited,.header-wrap .navigation-stick .main-title a, .header-wrap .navigation-stick .main-title a:hover, .header-wrap .navigation-stick .main-title a:visited', 'color', '', 'link_color' );
|
||||
|
||||
/**
|
||||
* Site tagline color
|
||||
* Empty: text_color
|
||||
*/
|
||||
generate_colors_live_update( 'site_tagline_color', '.site-description', 'color', '', 'text_color' );
|
||||
|
||||
/**
|
||||
* Main navigation background
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_background_color', '.main-navigation', 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Primary navigation text color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_text_color',
|
||||
'.main-navigation .main-nav ul li a,\
|
||||
.menu-toggle,button.menu-toggle:hover,\
|
||||
button.menu-toggle:focus,\
|
||||
.main-navigation .mobile-bar-items a,\
|
||||
.main-navigation .mobile-bar-items a:hover,\
|
||||
.main-navigation .mobile-bar-items a:focus',
|
||||
'color', '', 'link_color'
|
||||
);
|
||||
|
||||
/**
|
||||
* Primary navigation text color hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_text_hover_color',
|
||||
'.navigation-search input[type="search"],\
|
||||
.navigation-search input[type="search"]:active,\
|
||||
.navigation-search input[type="search"]:focus,\
|
||||
.main-navigation .main-nav ul li:hover > a,\
|
||||
.main-navigation .main-nav ul li:focus > a,\
|
||||
.main-navigation .main-nav ul li.sfHover > a',
|
||||
'color', '', 'link_color_hover'
|
||||
);
|
||||
|
||||
/**
|
||||
* Primary navigation menu item hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_background_hover_color',
|
||||
'.navigation-search input[type="search"],\
|
||||
.navigation-search input[type="search"]:focus,\
|
||||
.main-navigation .main-nav ul li:hover > a,\
|
||||
.main-navigation .main-nav ul li:focus > a,\
|
||||
.main-navigation .main-nav ul li.sfHover > a',
|
||||
'background-color', 'transparent'
|
||||
);
|
||||
|
||||
/**
|
||||
* Primary sub-navigation color
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_background_color', '.main-navigation ul ul', 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation text color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_text_color', '.main-navigation .main-nav ul ul li a', 'color', 'link_color' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation hover
|
||||
*/
|
||||
var subnavigation_hover = '.main-navigation .main-nav ul ul li:hover > a, \
|
||||
.main-navigation .main-nav ul ul li:focus > a, \
|
||||
.main-navigation .main-nav ul ul li.sfHover > a';
|
||||
|
||||
/**
|
||||
* Primary sub-navigation text hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_text_hover_color', subnavigation_hover, 'color', '', 'link_color_hover' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation background hover
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_background_hover_color', subnavigation_hover, 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Navigation current selectors
|
||||
*/
|
||||
var navigation_current = '.main-navigation .main-nav ul li[class*="current-menu-"] > a, \
|
||||
.main-navigation .main-nav ul li[class*="current-menu-"]:hover > a, \
|
||||
.main-navigation .main-nav ul li[class*="current-menu-"].sfHover > a';
|
||||
|
||||
/**
|
||||
* Primary navigation current text
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_text_current_color', navigation_current, 'color', '', 'link_color' );
|
||||
|
||||
/**
|
||||
* Primary navigation current text
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_background_current_color', navigation_current, 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation current selectors
|
||||
*/
|
||||
var subnavigation_current = '.main-navigation .main-nav ul ul li[class*="current-menu-"] > a,\
|
||||
.main-navigation .main-nav ul ul li[class*="current-menu-"]:hover > a, \
|
||||
.main-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a';
|
||||
|
||||
/**
|
||||
* Primary sub-navigation current text
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_text_current_color', subnavigation_current, 'color', '', 'link_color' );
|
||||
|
||||
/**
|
||||
* Primary navigation current item background
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_background_current_color', subnavigation_current, 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Secondary navigation background
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_background_color', '.secondary-navigation', 'background-color', 'transparent', '', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Secondary navigation text color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_text_color',
|
||||
'.secondary-navigation .main-nav ul li a,\
|
||||
.secondary-navigation .menu-toggle,\
|
||||
button.secondary-menu-toggle:hover,\
|
||||
button.secondary-menu-toggle:focus, \
|
||||
.secondary-navigation .top-bar, \
|
||||
.secondary-navigation .top-bar a',
|
||||
'color', '', 'link_color', 'generate_secondary_nav_settings'
|
||||
);
|
||||
|
||||
/**
|
||||
* Navigation search
|
||||
*/
|
||||
wp.customize( 'generate_settings[navigation_search_background_color]', function( value ) {
|
||||
value.bind( function( newval ) {
|
||||
if ( jQuery( 'style#navigation_search_background_color' ).length ) {
|
||||
jQuery( 'style#navigation_search_background_color' ).html( '.navigation-search input[type="search"],.navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus, .main-navigation .main-nav ul li.search-item.active > a{background-color:' + newval + ';}' );
|
||||
} else {
|
||||
jQuery( 'head' ).append( '<style id="navigation_search_background_color">.navigation-search input[type="search"],.navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus, .main-navigation .main-nav ul li.search-item.active > a{background-color:' + newval + ';}</style>' );
|
||||
setTimeout(function() {
|
||||
jQuery( 'style#navigation_search_background_color' ).not( ':last' ).remove();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
if ( jQuery( 'style#navigation_search_background_opacity' ).length ) {
|
||||
if ( newval ) {
|
||||
jQuery( 'style#navigation_search_background_opacity' ).html( '.navigation-search input{opacity: 1;}' );
|
||||
} else {
|
||||
jQuery( 'style#navigation_search_background_opacity' ).html( '.navigation-search input{opacity: 0.9;}' );
|
||||
}
|
||||
} else {
|
||||
if ( newval ) {
|
||||
jQuery( 'head' ).append( '<style id="navigation_search_background_opacity">.navigation-search input{opacity: 1;}</style>' );
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
jQuery( 'style#navigation_search_background_opacity' ).not( ':last' ).remove();
|
||||
}, 1000);
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
generate_colors_live_update( 'navigation_search_text_color', '.navigation-search input[type="search"],.navigation-search input[type="search"]:active, .navigation-search input[type="search"]:focus, .main-navigation .main-nav ul li.search-item.active > a', 'color', '' );
|
||||
|
||||
/**
|
||||
* Secondary navigation text color hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_text_hover_color',
|
||||
'.secondary-navigation .main-nav ul li:hover > a, \
|
||||
.secondary-navigation .main-nav ul li:focus > a, \
|
||||
.secondary-navigation .main-nav ul li.sfHover > a',
|
||||
'color', '', 'link_color_hover', 'generate_secondary_nav_settings'
|
||||
);
|
||||
|
||||
/**
|
||||
* Secondary navigation menu item hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_background_hover_color',
|
||||
'.secondary-navigation .main-nav ul li:hover > a, \
|
||||
.secondary-navigation .main-nav ul li:focus > a, \
|
||||
.secondary-navigation .main-nav ul li.sfHover > a',
|
||||
'background-color', 'transparent', '', 'generate_secondary_nav_settings'
|
||||
);
|
||||
|
||||
/**
|
||||
* Secondary navigation top bar link hover
|
||||
*/
|
||||
wp.customize( 'generate_secondary_nav_settings[navigation_background_hover_color]', function( value ) {
|
||||
value.bind( function( newval ) {
|
||||
if ( jQuery( 'style#secondary_nav_top_bar_hover' ).length ) {
|
||||
jQuery( 'style#secondary_nav_top_bar_hover' ).html( '.secondary-navigation .top-bar a:hover,.secondary-navigation .top-bar a:focus{color:' + newval + ';}' );
|
||||
} else {
|
||||
jQuery( 'head' ).append( '<style id="secondary_nav_top_bar_hover">.secondary-navigation .top-bar a:hover,.secondary-navigation .top-bar a:focus{color:' + newval + ';}</style>' );
|
||||
setTimeout(function() {
|
||||
jQuery( 'style#secondary_nav_top_bar_hover' ).not( ':last' ).remove();
|
||||
}, 1000);
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
generate_colors_live_update( 'navigation_top_bar_hover_color',
|
||||
'.secondary-navigation .top-bar a:hover, \
|
||||
.secondary-navigation .top-bar a:focus',
|
||||
'color', 'transparent', '', 'generate_secondary_nav_settings'
|
||||
);
|
||||
|
||||
/**
|
||||
* Secondary sub-navigation color
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_background_color', '.secondary-navigation ul ul', 'background-color', 'transparent', '', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Secondary sub-navigation text color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_text_color', '.secondary-navigation .main-nav ul ul li a', 'color', '', 'link_color', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Secondary sub-navigation hover
|
||||
*/
|
||||
var secondary_subnavigation_hover = '.secondary-navigation .main-nav ul ul li > a:hover, \
|
||||
.secondary-navigation .main-nav ul ul li:focus > a, \
|
||||
.secondary-navigation .main-nav ul ul li.sfHover > a';
|
||||
|
||||
/**
|
||||
* Secondary sub-navigation text hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_text_hover_color', secondary_subnavigation_hover, 'color', '', 'link_color_hover', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Secondary sub-navigation background hover
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_background_hover_color', secondary_subnavigation_hover, 'background-color', 'transparent', '', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Secondary navigation current selectors
|
||||
*/
|
||||
var secondary_navigation_current = '.secondary-navigation .main-nav ul li[class*="current-menu-"] > a, \
|
||||
.secondary-navigation .main-nav ul li[class*="current-menu-"]:hover > a, \
|
||||
.secondary-navigation .main-nav ul li[class*="current-menu-"].sfHover > a';
|
||||
|
||||
/**
|
||||
* Secondary navigation current text
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_text_current_color', secondary_navigation_current, 'color', '', 'link_color', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Secondary navigation current text
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'navigation_background_current_color', secondary_navigation_current, 'background-color', 'transparent', '', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Secondary sub-navigation current selectors
|
||||
*/
|
||||
var secondary_subnavigation_current = '.secondary-navigation .main-nav ul ul li[class*="current-menu-"] > a,\
|
||||
.secondary-navigation .main-nav ul ul li[class*="current-menu-"]:hover > a, \
|
||||
.secondary-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a';
|
||||
|
||||
/**
|
||||
* Secondary sub-navigation current text
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_text_current_color', secondary_subnavigation_current, 'color', '', 'link_color', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Primary navigation current item background
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'subnavigation_background_current_color', secondary_subnavigation_current, 'background-color', 'transparent', '', 'generate_secondary_nav_settings' );
|
||||
|
||||
/**
|
||||
* Content selectors
|
||||
*/
|
||||
var content = '.separate-containers .inside-article,\
|
||||
.separate-containers .comments-area,\
|
||||
.separate-containers .page-header,\
|
||||
.one-container .container,\
|
||||
.separate-containers .paging-navigation,\
|
||||
.inside-page-header';
|
||||
|
||||
/**
|
||||
* Content background
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'content_background_color', content, 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Content text color
|
||||
* Empty: text_color
|
||||
*/
|
||||
generate_colors_live_update( 'content_text_color', content, 'color', '', 'text_color' );
|
||||
|
||||
/**
|
||||
* Content links
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'content_link_color',
|
||||
'.inside-article a:not(.button):not(.wp-block-button__link)[data-content-link-color=true], \
|
||||
.inside-article a:not(.button):not(.wp-block-button__link)[data-content-link-color=true]:visited,\
|
||||
.paging-navigation a,\
|
||||
.paging-navigation a:visited,\
|
||||
.comments-area a,\
|
||||
.comments-area a:visited,\
|
||||
.page-header a,\
|
||||
.page-header a:visited',
|
||||
'color', '', 'link_color'
|
||||
);
|
||||
|
||||
/**
|
||||
* Content links on hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'content_link_hover_color',
|
||||
'.inside-article a:not(.button):not(.wp-block-button__link)[data-content-link-color=true]:hover,\
|
||||
.paging-navigation a:hover,\
|
||||
.comments-area a:hover,\
|
||||
.page-header a:hover',
|
||||
'color', '', 'link_color_hover'
|
||||
);
|
||||
|
||||
generate_colors_live_update( 'content_title_color', '.entry-header h1,.page-header h1', 'color', 'inherit', 'text_color' );
|
||||
generate_colors_live_update( 'blog_post_title_color', '.entry-title a,.entry-title a:visited', 'color', '', 'link_color' );
|
||||
generate_colors_live_update( 'blog_post_title_hover_color', '.entry-title a:hover', 'color', '', 'link_color_hover' );
|
||||
generate_colors_live_update( 'entry_meta_text_color', '.entry-meta', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'entry_meta_link_color', '.entry-meta a, .entry-meta a:visited', 'color', '', 'link_color' );
|
||||
generate_colors_live_update( 'entry_meta_link_color_hover', '.entry-meta a:hover', 'color', '', 'link_color_hover' );
|
||||
generate_colors_live_update( 'h1_color', 'h1', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'h2_color', 'h2', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'h3_color', 'h3', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'h4_color', 'h4', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'h5_color', 'h5', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'sidebar_widget_background_color', '.sidebar .widget', 'background-color', 'transparent' );
|
||||
generate_colors_live_update( 'sidebar_widget_text_color', '.sidebar .widget', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'sidebar_widget_link_color', '.sidebar .widget a, .sidebar .widget a:visited', 'color', '', 'link_color' );
|
||||
generate_colors_live_update( 'sidebar_widget_link_hover_color', '.sidebar .widget a:hover', 'color', '', 'link_color_hover' );
|
||||
generate_colors_live_update( 'sidebar_widget_title_color', '.sidebar .widget .widget-title', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'footer_widget_background_color', '.footer-widgets', 'background-color', 'transparent' );
|
||||
generate_colors_live_update( 'footer_widget_text_color', '.footer-widgets', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'footer_widget_link_color', '.footer-widgets a, .footer-widgets a:visited', 'color', '', 'link_color' );
|
||||
generate_colors_live_update( 'footer_widget_link_hover_color', '.footer-widgets a:hover', 'color', '', 'link_color_hover' );
|
||||
generate_colors_live_update( 'footer_widget_title_color', '.footer-widgets .widget-title', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'footer_background_color', '.site-info', 'background-color', 'transparent' );
|
||||
generate_colors_live_update( 'footer_text_color', '.site-info', 'color', '', 'text_color' );
|
||||
generate_colors_live_update( 'footer_link_color', '.site-info a, .site-info a:visited', 'color', '', 'link_color' );
|
||||
generate_colors_live_update( 'footer_link_hover_color', '.site-info a:hover', 'color', '', 'link_color_hover' );
|
||||
|
||||
/**
|
||||
* Form selectors
|
||||
*/
|
||||
var forms = 'input[type="text"], \
|
||||
input[type="email"], \
|
||||
input[type="url"], \
|
||||
input[type="password"], \
|
||||
input[type="search"], \
|
||||
input[type="number"], \
|
||||
input[type="tel"], \
|
||||
textarea, \
|
||||
select';
|
||||
|
||||
/**
|
||||
* Form background
|
||||
* Empty: inherit
|
||||
*/
|
||||
generate_colors_live_update( 'form_background_color', forms, 'background-color', 'inherit' );
|
||||
|
||||
/**
|
||||
* Border color
|
||||
* Empty: inherit
|
||||
*/
|
||||
generate_colors_live_update( 'form_border_color', forms, 'border-color' );
|
||||
|
||||
/**
|
||||
* Form text color
|
||||
* Empty: text_color
|
||||
*/
|
||||
generate_colors_live_update( 'form_text_color', forms, 'color', '', 'text_color' );
|
||||
|
||||
/**
|
||||
* Form background on focus selectors
|
||||
* Empty: inherit
|
||||
*/
|
||||
var forms_focus = 'input[type="text"]:focus, \
|
||||
input[type="email"]:focus, \
|
||||
input[type="url"]:focus, \
|
||||
input[type="password"]:focus, \
|
||||
input[type="search"]:focus,\
|
||||
input[type="number"]:focus,\
|
||||
input[type="tel"]:focus, \
|
||||
textarea:focus, \
|
||||
select:focus';
|
||||
|
||||
/**
|
||||
* Form background color on focus
|
||||
* Empty: initial
|
||||
*/
|
||||
generate_colors_live_update( 'form_background_color_focus', forms_focus, 'background-color' );
|
||||
|
||||
/**
|
||||
* Form text color on focus
|
||||
* Empty: initial
|
||||
*/
|
||||
generate_colors_live_update( 'form_text_color_focus', forms_focus, 'color' );
|
||||
|
||||
/**
|
||||
* Form border color on focus
|
||||
* Empty: initial
|
||||
*/
|
||||
generate_colors_live_update( 'form_border_color_focus', forms_focus, 'border-color' );
|
||||
|
||||
/**
|
||||
* Button selectors
|
||||
*/
|
||||
var button = 'button, \
|
||||
html input[type="button"], \
|
||||
input[type="reset"], \
|
||||
input[type="submit"],\
|
||||
a.button,\
|
||||
a.button:visited,\
|
||||
a.wp-block-button__link:not(.has-background)';
|
||||
|
||||
/**
|
||||
* Button background
|
||||
* Empty: initial
|
||||
*/
|
||||
generate_colors_live_update( 'form_button_background_color', button, 'background-color' );
|
||||
|
||||
/**
|
||||
* Button text
|
||||
* Empty: initial
|
||||
*/
|
||||
generate_colors_live_update( 'form_button_text_color', button, 'color' );
|
||||
|
||||
/**
|
||||
* Button on hover/focus selectors
|
||||
* Empty: initial
|
||||
*/
|
||||
var button_hover = 'button:hover, \
|
||||
html input[type="button"]:hover, \
|
||||
input[type="reset"]:hover, \
|
||||
input[type="submit"]:hover,\
|
||||
a.button:hover,\
|
||||
button:focus, \
|
||||
html input[type="button"]:focus, \
|
||||
input[type="reset"]:focus, \
|
||||
input[type="submit"]:focus,\
|
||||
a.button:focus,\
|
||||
a.wp-block-button__link:not(.has-background):active,\
|
||||
a.wp-block-button__link:not(.has-background):focus,\
|
||||
a.wp-block-button__link:not(.has-background):hover';
|
||||
|
||||
/**
|
||||
* Button color on hover
|
||||
* Empty: initial
|
||||
*/
|
||||
generate_colors_live_update( 'form_button_background_color_hover', button_hover, 'background-color' );
|
||||
|
||||
/**
|
||||
* Button text color on hover
|
||||
* Empty: initial
|
||||
*/
|
||||
generate_colors_live_update( 'form_button_text_color_hover', button_hover, 'color' );
|
||||
|
||||
/**
|
||||
* Back to top background color
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'back_to_top_background_color', '.generate-back-to-top,.generate-back-to-top:visited', 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Back to top text color
|
||||
* Empty: text_color
|
||||
*/
|
||||
generate_colors_live_update( 'back_to_top_text_color', '.generate-back-to-top,.generate-back-to-top:visited', 'color', '', 'text_color' );
|
||||
|
||||
/**
|
||||
* Back to top background color hover
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'back_to_top_background_color_hover', '.generate-back-to-top:hover,.generate-back-to-top:focus', 'background-color', 'transparent' );
|
||||
|
||||
/**
|
||||
* Back to top text color hover
|
||||
* Empty: text_color
|
||||
*/
|
||||
generate_colors_live_update( 'back_to_top_text_color_hover', '.generate-back-to-top:hover,.generate-back-to-top:focus', 'color', '', 'text_color' );
|
@ -0,0 +1,102 @@
|
||||
/**
|
||||
* Main navigation background
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_background_color', '.main-navigation.slideout-navigation', 'background-color', '' );
|
||||
|
||||
/**
|
||||
* Primary navigation text color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_text_color', '.slideout-navigation.main-navigation .main-nav ul li a, .slideout-navigation a, .slideout-navigation', 'color', '' );
|
||||
|
||||
/**
|
||||
* Primary navigation text color hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_text_hover_color',
|
||||
'.slideout-navigation.main-navigation .main-nav ul li:hover > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul li:focus > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul li.sfHover > a',
|
||||
'color', ''
|
||||
);
|
||||
|
||||
/**
|
||||
* Primary navigation menu item hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_background_hover_color',
|
||||
'.slideout-navigation.main-navigation .main-nav ul li:hover > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul li:focus > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul li.sfHover > a',
|
||||
'background-color', 'transparent'
|
||||
);
|
||||
|
||||
/**
|
||||
* Primary sub-navigation color
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_submenu_background_color', '.slideout-navigation.main-navigation ul ul', 'background-color', '' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation text color
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_submenu_text_color', '.slideout-navigation.main-navigation .main-nav ul ul li a', 'color', '' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation hover
|
||||
*/
|
||||
var slideout_submenu_hover = '.slideout-navigation.main-navigation .main-nav ul ul li:hover > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul ul li:focus > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul ul li.sfHover > a';
|
||||
|
||||
/**
|
||||
* Primary sub-navigation text hover
|
||||
* Empty: link_color_hover
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_submenu_text_hover_color', slideout_submenu_hover, 'color', '' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation background hover
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_submenu_background_hover_color', slideout_submenu_hover, 'background-color', '' );
|
||||
|
||||
/**
|
||||
* Navigation current selectors
|
||||
*/
|
||||
var slideout_current = '.slideout-navigation.main-navigation .main-nav ul li[class*="current-menu-"] > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul li[class*="current-menu-"] > a:hover,\
|
||||
.slideout-navigation.main-navigation .main-nav ul li[class*="current-menu-"].sfHover > a';
|
||||
|
||||
/**
|
||||
* Primary navigation current text
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_text_current_color', slideout_current, 'color', '' );
|
||||
|
||||
/**
|
||||
* Primary navigation current text
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_background_current_color', slideout_current, 'background-color' );
|
||||
|
||||
/**
|
||||
* Primary sub-navigation current selectors
|
||||
*/
|
||||
var slideout_submenu_current = '.slideout-navigation.main-navigation .main-nav ul ul li[class*="current-menu-"] > a,\
|
||||
.slideout-navigation.main-navigation .main-nav ul ul li[class*="current-menu-"] > a:hover,\
|
||||
.slideout-navigation.main-navigation .main-nav ul ul li[class*="current-menu-"].sfHover > a';
|
||||
|
||||
/**
|
||||
* Primary sub-navigation current text
|
||||
* Empty: link_color
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_submenu_text_current_color', slideout_submenu_current, 'color', '' );
|
||||
|
||||
/**
|
||||
* Primary navigation current item background
|
||||
* Empty: transparent
|
||||
*/
|
||||
generate_colors_live_update( 'slideout_submenu_background_current_color', slideout_submenu_current, 'background-color' );
|
@ -0,0 +1,161 @@
|
||||
/**
|
||||
* WooCommerce link color
|
||||
*/
|
||||
generate_colors_live_update( 'wc_product_title_color', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link', 'color', '', 'link_color' );
|
||||
generate_colors_live_update( 'wc_product_title_color_hover', '.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover', 'color', '', 'link_color_hover' );
|
||||
|
||||
/**
|
||||
* WooCommerce primary button
|
||||
*/
|
||||
var wc_button = '.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, button, \
|
||||
html input[type="button"], \
|
||||
input[type="reset"], \
|
||||
input[type="submit"],\
|
||||
.button,\
|
||||
.button:visited';
|
||||
generate_colors_live_update( 'form_button_background_color', wc_button, 'background-color' );
|
||||
generate_colors_live_update( 'form_button_text_color', wc_button, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce primary button hover
|
||||
*/
|
||||
var wc_button_hover = '.woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,button:hover, \
|
||||
html input[type="button"]:hover, \
|
||||
input[type="reset"]:hover, \
|
||||
input[type="submit"]:hover,\
|
||||
.button:hover,\
|
||||
button:focus, \
|
||||
html input[type="button"]:focus, \
|
||||
input[type="reset"]:focus, \
|
||||
input[type="submit"]:focus,\
|
||||
.button:focus';
|
||||
generate_colors_live_update( 'form_button_background_color_hover', wc_button_hover, 'background-color' );
|
||||
generate_colors_live_update( 'form_button_text_color_hover', wc_button_hover, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce alt button
|
||||
*/
|
||||
var wc_alt_button = '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt';
|
||||
generate_colors_live_update( 'wc_alt_button_background', wc_alt_button, 'background-color' );
|
||||
generate_colors_live_update( 'wc_alt_button_text', wc_alt_button, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce alt button hover
|
||||
*/
|
||||
var wc_alt_button_hover = '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover';
|
||||
generate_colors_live_update( 'wc_alt_button_background_hover', wc_alt_button_hover, 'background-color' );
|
||||
generate_colors_live_update( 'wc_alt_button_text_hover', wc_alt_button_hover, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce star ratings
|
||||
*/
|
||||
var wc_stars = '.woocommerce .star-rating span:before, .woocommerce .star-rating:before';
|
||||
generate_colors_live_update( 'wc_rating_stars', wc_stars, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce sale sticker
|
||||
*/
|
||||
var wc_sale_sticker = '.woocommerce span.onsale';
|
||||
generate_colors_live_update( 'wc_sale_sticker_background', wc_sale_sticker, 'background-color' );
|
||||
generate_colors_live_update( 'wc_sale_sticker_text', wc_sale_sticker, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce price
|
||||
*/
|
||||
var wc_price = '.woocommerce ul.products li.product .price, .woocommerce div.product p.price';
|
||||
generate_colors_live_update( 'wc_price_color', wc_price, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce product tab text
|
||||
*/
|
||||
var wc_product_tab = '.woocommerce div.product .woocommerce-tabs ul.tabs li a';
|
||||
generate_colors_live_update( 'wc_product_tab', wc_product_tab, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce product tab text highlight/active
|
||||
*/
|
||||
var wc_product_tab_active = '.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover, .woocommerce div.product .woocommerce-tabs ul.tabs li.active a';
|
||||
generate_colors_live_update( 'wc_product_tab_highlight', wc_product_tab_active, 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce success message
|
||||
*/
|
||||
var wc_success_message = '.woocommerce-message';
|
||||
generate_colors_live_update( 'wc_success_message_background', wc_success_message, 'background-color' );
|
||||
generate_colors_live_update( 'wc_success_message_text', wc_success_message + ', div.woocommerce-message a.button, div.woocommerce-message a.button:focus, div.woocommerce-message a.button:hover, div.woocommerce-message a, div.woocommerce-message a:focus, div.woocommerce-message a:hover', 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce info message
|
||||
*/
|
||||
var wc_info_message = '.woocommerce-info';
|
||||
generate_colors_live_update( 'wc_info_message_background', wc_info_message, 'background-color' );
|
||||
generate_colors_live_update( 'wc_info_message_text', wc_info_message + ', div.woocommerce-info a.button, div.woocommerce-info a.button:focus, div.woocommerce-info a.button:hover, div.woocommerce-info a, div.woocommerce-info a:focus, div.woocommerce-info a:hover', 'color' );
|
||||
|
||||
/**
|
||||
* WooCommerce error message
|
||||
*/
|
||||
var wc_error_message = '.woocommerce-error';
|
||||
generate_colors_live_update( 'wc_error_message_background', wc_error_message, 'background-color' );
|
||||
generate_colors_live_update( 'wc_error_message_text', wc_error_message + ', div.woocommerce-error a.button, div.woocommerce-error a.button:focus, div.woocommerce-error a.button:hover, div.woocommerce-error a, div.woocommerce-error a:focus, div.woocommerce-error a:hover', 'color' );
|
||||
|
||||
/**
|
||||
* Menu Mini Cart
|
||||
*/
|
||||
generate_colors_live_update( 'wc_mini_cart_background_color', '#wc-mini-cart', 'background-color' );
|
||||
generate_colors_live_update( 'wc_mini_cart_text_color', '#wc-mini-cart,#wc-mini-cart a:not(.button), #wc-mini-cart a.remove', 'color' );
|
||||
|
||||
generate_colors_live_update( 'wc_mini_cart_button_background', '#wc-mini-cart .button.checkout', 'background-color' );
|
||||
generate_colors_live_update( 'wc_mini_cart_button_text', '#wc-mini-cart .button.checkout', 'color' );
|
||||
|
||||
generate_colors_live_update( 'wc_mini_cart_button_background_hover', '#wc-mini-cart .button.checkout:hover, #wc-mini-cart .button.checkout:focus, #wc-mini-cart .button.checkout:active', 'background-color' );
|
||||
generate_colors_live_update( 'wc_mini_cart_button_text_hover', '#wc-mini-cart .button.checkout:hover, #wc-mini-cart .button.checkout:focus, #wc-mini-cart .button.checkout:active', 'color' );
|
||||
|
||||
/**
|
||||
* Sticky panel cart button
|
||||
*/
|
||||
generate_colors_live_update( 'wc_panel_cart_background_color', '.add-to-cart-panel', 'background-color' );
|
||||
generate_colors_live_update( 'wc_panel_cart_text_color', '.add-to-cart-panel, .add-to-cart-panel a:not(.button)', 'color' );
|
||||
|
||||
generate_colors_live_update( 'wc_panel_cart_button_background', '#wc-sticky-cart-panel .button', 'background-color' );
|
||||
generate_colors_live_update( 'wc_panel_cart_button_text', '#wc-sticky-cart-panel .button', 'color' );
|
||||
|
||||
generate_colors_live_update( 'wc_panel_cart_button_background_hover', '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', 'background-color' );
|
||||
generate_colors_live_update( 'wc_panel_cart_button_text_hover', '#wc-sticky-cart-panel .button:hover, #wc-sticky-cart-panel .button:focus, #wc-sticky-cart-panel .button:active', 'color' );
|
||||
|
||||
/**
|
||||
* Price slider bar
|
||||
*/
|
||||
generate_colors_live_update( 'wc_price_slider_background_color', '.woocommerce .widget_price_filter .price_slider_wrapper .ui-widget-content', 'background-color' );
|
||||
generate_colors_live_update( 'wc_price_slider_bar_color', '.woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce .widget_price_filter .ui-slider .ui-slider-handle', 'background-color' );
|
||||
|
||||
// Archive product description text
|
||||
wp.customize( 'generate_settings[text_color]', function( value ) {
|
||||
value.bind( function( newval ) {
|
||||
if ( ! wp.customize.value('generate_settings[content_text_color]')() ) {
|
||||
if ( jQuery( 'style#wc_desc_color' ).length ) {
|
||||
jQuery( 'style#wc_desc_color' ).html( '.woocommerce-product-details__short-description{color:' + newval + ';}' );
|
||||
} else {
|
||||
jQuery( 'head' ).append( '<style id="wc_desc_color">.woocommerce-product-details__short-description{color:' + newval + ';}</style>' );
|
||||
setTimeout(function() {
|
||||
jQuery( 'style#wc_desc_color' ).not( ':last' ).remove();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
wp.customize( 'generate_settings[content_text_color]', function( value ) {
|
||||
value.bind( function( newval ) {
|
||||
if ( '' == newval ) {
|
||||
newval = wp.customize.value('generate_settings[text_color]')();
|
||||
}
|
||||
if ( jQuery( 'style#wc_desc_color' ).length ) {
|
||||
jQuery( 'style#wc_desc_color' ).html( '.woocommerce-product-details__short-description{color:' + newval + ';}' );
|
||||
} else {
|
||||
jQuery( 'head' ).append( '<style id="wc_desc_color">.woocommerce-product-details__short-description{color:' + newval + ';}</style>' );
|
||||
setTimeout(function() {
|
||||
jQuery( 'style#wc_desc_color' ).not( ':last' ).remove();
|
||||
}, 1000);
|
||||
}
|
||||
} );
|
||||
} );
|
@ -0,0 +1,384 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
|
||||
add_action( 'customize_register', 'generate_colors_secondary_nav_customizer', 1000 );
|
||||
/**
|
||||
* Adds our Secondary Nav color options
|
||||
*
|
||||
* These options are in their own function so we can hook it in late to
|
||||
* make sure Secondary Nav is activated.
|
||||
*
|
||||
* 1000 priority is there to make sure Secondary Nav is registered (999)
|
||||
* as we check to see if the layout control exists.
|
||||
*
|
||||
* Secondary Nav now uses 100 as a priority.
|
||||
*/
|
||||
function generate_colors_secondary_nav_customizer( $wp_customize ) {
|
||||
|
||||
// Bail if Secondary Nav isn't activated
|
||||
if ( ! $wp_customize->get_section( 'secondary_nav_section' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Bail if we don't have our color defaults
|
||||
if ( ! function_exists( 'generate_secondary_nav_get_defaults' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add our controls
|
||||
require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';
|
||||
|
||||
// Get our defaults
|
||||
$defaults = generate_secondary_nav_get_defaults();
|
||||
|
||||
// Add control types so controls can be built using JS
|
||||
if ( method_exists( $wp_customize, 'register_control_type' ) ) {
|
||||
$wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' );
|
||||
$wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' );
|
||||
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
|
||||
}
|
||||
|
||||
// Get our palettes
|
||||
$palettes = generate_get_default_color_palettes();
|
||||
|
||||
// Add Secondary Navigation section
|
||||
$wp_customize->add_section(
|
||||
'secondary_navigation_color_section',
|
||||
array(
|
||||
'title' => __( 'Secondary Navigation', 'gp-premium' ),
|
||||
'capability' => 'edit_theme_options',
|
||||
'priority' => 71,
|
||||
'panel' => 'generate_colors_panel',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Section_Shortcut_Control(
|
||||
$wp_customize,
|
||||
'generate_secondary_navigation_color_shortcuts',
|
||||
array(
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'element' => __( 'Secondary Navigation', 'gp-premium' ),
|
||||
'shortcuts' => array(
|
||||
'layout' => 'secondary_nav_section',
|
||||
'typography' => 'secondary_font_section',
|
||||
'backgrounds' => 'secondary_bg_images_section',
|
||||
),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
'priority' => 1,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_secondary_navigation_items',
|
||||
array(
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Parent Items', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[navigation_background_color]', array(
|
||||
'default' => $defaults['navigation_background_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'secondary_navigation_background_color',
|
||||
array(
|
||||
'label' => __( 'Background', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[navigation_background_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[navigation_text_color]', array(
|
||||
'default' => $defaults['navigation_text_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'secondary_navigation_text_color',
|
||||
array(
|
||||
'label' => __( 'Text', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[navigation_text_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[navigation_background_hover_color]', array(
|
||||
'default' => $defaults['navigation_background_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'secondary_navigation_background_hover_color',
|
||||
array(
|
||||
'label' => __( 'Background Hover', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[navigation_background_hover_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[navigation_text_hover_color]', array(
|
||||
'default' => $defaults['navigation_text_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'secondary_navigation_text_hover_color',
|
||||
array(
|
||||
'label' => __( 'Text Hover', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[navigation_text_hover_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background current
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[navigation_background_current_color]', array(
|
||||
'default' => $defaults['navigation_background_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'secondary_navigation_background_current_color',
|
||||
array(
|
||||
'label' => __( 'Background Current', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[navigation_background_current_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text current
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[navigation_text_current_color]', array(
|
||||
'default' => $defaults['navigation_text_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'secondary_navigation_text_current_color',
|
||||
array(
|
||||
'label' => __( 'Text Current', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[navigation_text_current_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_secondary_navigation_sub_menu_items',
|
||||
array(
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Sub-Menu Items', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[subnavigation_background_color]', array(
|
||||
'default' => $defaults['subnavigation_background_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'secondary_subnavigation_background_color',
|
||||
array(
|
||||
'label' => __( 'Background', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[subnavigation_background_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[subnavigation_text_color]', array(
|
||||
'default' => $defaults['subnavigation_text_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'secondary_subnavigation_text_color',
|
||||
array(
|
||||
'label' => __( 'Text', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[subnavigation_text_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[subnavigation_background_hover_color]', array(
|
||||
'default' => $defaults['subnavigation_background_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'secondary_subnavigation_background_hover_color',
|
||||
array(
|
||||
'label' => __( 'Background Hover', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[subnavigation_background_hover_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[subnavigation_text_hover_color]', array(
|
||||
'default' => $defaults['subnavigation_text_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'secondary_subnavigation_text_hover_color',
|
||||
array(
|
||||
'label' => __( 'Text Hover', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[subnavigation_text_hover_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background current
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[subnavigation_background_current_color]', array(
|
||||
'default' => $defaults['subnavigation_background_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'secondary_subnavigation_background_current_color',
|
||||
array(
|
||||
'label' => __( 'Background Current', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[subnavigation_background_current_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text current
|
||||
$wp_customize->add_setting(
|
||||
'generate_secondary_nav_settings[subnavigation_text_current_color]', array(
|
||||
'default' => $defaults['subnavigation_text_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'secondary_subnavigation_text_current_color',
|
||||
array(
|
||||
'label' => __( 'Text Current', 'gp-premium' ),
|
||||
'section' => 'secondary_navigation_color_section',
|
||||
'settings' => 'generate_secondary_nav_settings[subnavigation_text_current_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,378 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // No direct access, please
|
||||
}
|
||||
|
||||
add_action( 'customize_preview_init', 'generate_menu_plus_live_preview_scripts', 20 );
|
||||
function generate_menu_plus_live_preview_scripts() {
|
||||
wp_enqueue_script( 'generate-menu-plus-colors-customizer' );
|
||||
}
|
||||
|
||||
add_action( 'customize_register', 'generate_slideout_navigation_color_controls', 150 );
|
||||
/**
|
||||
* Adds our Slideout Nav color options
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
function generate_slideout_navigation_color_controls( $wp_customize ) {
|
||||
// Bail if Secondary Nav isn't activated
|
||||
if ( ! $wp_customize->get_section( 'menu_plus_slideout_menu' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Bail if we don't have our color defaults
|
||||
if ( ! function_exists( 'generate_get_color_defaults' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add our controls
|
||||
require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';
|
||||
|
||||
// Get our defaults
|
||||
$defaults = generate_get_color_defaults();
|
||||
|
||||
// Add control types so controls can be built using JS
|
||||
if ( method_exists( $wp_customize, 'register_control_type' ) ) {
|
||||
$wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' );
|
||||
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
|
||||
}
|
||||
|
||||
// Get our palettes
|
||||
$palettes = generate_get_default_color_palettes();
|
||||
|
||||
// Add Secondary Navigation section
|
||||
$wp_customize->add_section(
|
||||
'slideout_color_section',
|
||||
array(
|
||||
'title' => __( 'Off Canvas Panel', 'gp-premium' ),
|
||||
'capability' => 'edit_theme_options',
|
||||
'priority' => 73,
|
||||
'panel' => 'generate_colors_panel',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Section_Shortcut_Control(
|
||||
$wp_customize,
|
||||
'generate_off_canvas_color_shortcuts',
|
||||
array(
|
||||
'section' => 'slideout_color_section',
|
||||
'element' => __( 'Off Canvas Panel', 'gp-premium' ),
|
||||
'shortcuts' => array(
|
||||
'layout' => 'menu_plus_slideout_menu',
|
||||
'typography' => 'generate_slideout_typography',
|
||||
),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
'priority' => 1,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_slideout_navigation_items',
|
||||
array(
|
||||
'section' => 'slideout_color_section',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Parent Menu Items', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_background_color]', array(
|
||||
'default' => $defaults['slideout_background_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_background_color]',
|
||||
array(
|
||||
'label' => __( 'Background', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_background_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_text_color]', array(
|
||||
'default' => $defaults['slideout_text_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_text_color]',
|
||||
array(
|
||||
'label' => __( 'Text', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_text_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_background_hover_color]', array(
|
||||
'default' => $defaults['slideout_background_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_background_hover_color]',
|
||||
array(
|
||||
'label' => __( 'Background Hover', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_background_hover_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_text_hover_color]', array(
|
||||
'default' => $defaults['slideout_text_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_text_hover_color]',
|
||||
array(
|
||||
'label' => __( 'Text Hover', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_text_hover_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background current
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_background_current_color]', array(
|
||||
'default' => $defaults['slideout_background_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_background_current_color]',
|
||||
array(
|
||||
'label' => __( 'Background Current', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_background_current_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text current
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_text_current_color]', array(
|
||||
'default' => $defaults['slideout_text_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_text_current_color]',
|
||||
array(
|
||||
'label' => __( 'Text Current', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_text_current_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_slideout_navigation_sub_menu_items',
|
||||
array(
|
||||
'section' => 'slideout_color_section',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Sub-Menu Items', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_submenu_background_color]', array(
|
||||
'default' => $defaults['slideout_submenu_background_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_submenu_background_color]',
|
||||
array(
|
||||
'label' => __( 'Background', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_submenu_background_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_submenu_text_color]', array(
|
||||
'default' => $defaults['slideout_submenu_text_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_submenu_text_color]',
|
||||
array(
|
||||
'label' => __( 'Text', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_submenu_text_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_submenu_background_hover_color]', array(
|
||||
'default' => $defaults['slideout_submenu_background_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_submenu_background_hover_color]',
|
||||
array(
|
||||
'label' => __( 'Background Hover', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_submenu_background_hover_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text hover
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_submenu_text_hover_color]', array(
|
||||
'default' => $defaults['slideout_submenu_text_hover_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_submenu_text_hover_color]',
|
||||
array(
|
||||
'label' => __( 'Text Hover', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_submenu_text_hover_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Background current
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_submenu_background_current_color]', array(
|
||||
'default' => $defaults['slideout_submenu_background_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_submenu_background_current_color]',
|
||||
array(
|
||||
'label' => __( 'Background Current', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_submenu_background_current_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Text current
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[slideout_submenu_text_current_color]', array(
|
||||
'default' => $defaults['slideout_submenu_text_current_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[slideout_submenu_text_current_color]',
|
||||
array(
|
||||
'label' => __( 'Text Current', 'gp-premium' ),
|
||||
'section' => 'slideout_color_section',
|
||||
'settings' => 'generate_settings[slideout_submenu_text_current_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,882 @@
|
||||
<?php
|
||||
// No direct access, please
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
|
||||
add_action( 'customize_register', 'generate_colors_wc_customizer', 100 );
|
||||
/**
|
||||
* Adds our WooCommerce color options
|
||||
*/
|
||||
function generate_colors_wc_customizer( $wp_customize ) {
|
||||
// Bail if WooCommerce isn't activated
|
||||
if ( ! $wp_customize->get_section( 'generate_woocommerce_colors' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_get_color_defaults' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add our controls
|
||||
require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';
|
||||
|
||||
// Get our defaults
|
||||
$defaults = generate_get_color_defaults();
|
||||
|
||||
// Add control types so controls can be built using JS
|
||||
if ( method_exists( $wp_customize, 'register_control_type' ) ) {
|
||||
$wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' );
|
||||
$wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' );
|
||||
$wp_customize->register_control_type( 'GeneratePress_Information_Customize_Control' );
|
||||
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
|
||||
}
|
||||
|
||||
// Get our palettes
|
||||
$palettes = generate_get_default_color_palettes();
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Section_Shortcut_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_color_shortcuts',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'element' => __( 'WooCommerce', 'gp-premium' ),
|
||||
'shortcuts' => array(
|
||||
'layout' => 'generate_woocommerce_layout',
|
||||
'typography' => 'generate_woocommerce_typography',
|
||||
),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
'priority' => 0,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_button_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Buttons', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Information_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_primary_button_message',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'label' => __( 'Primary Button Colors','generate-woocommerce' ),
|
||||
'description' => __( 'Primary button colors can be set <a href="#">here</a>.','generate-woocommerce' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_alt_button_background]',
|
||||
array(
|
||||
'default' => $defaults['wc_alt_button_background'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_alt_button_background]',
|
||||
array(
|
||||
'label' => __( 'Alt Button Background', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_alt_button_background]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_alt_button_background_hover]',
|
||||
array(
|
||||
'default' => $defaults['wc_alt_button_background_hover'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_alt_button_background_hover]',
|
||||
array(
|
||||
'label' => __( 'Alt Button Background Hover', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_alt_button_background_hover]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_alt_button_text]', array(
|
||||
'default' => $defaults['wc_alt_button_text'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_alt_button_text]',
|
||||
array(
|
||||
'label' => __( 'Alt Button Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_alt_button_text]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_alt_button_text_hover]', array(
|
||||
'default' => $defaults['wc_alt_button_text_hover'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_alt_button_text_hover]',
|
||||
array(
|
||||
'label' => __( 'Alt Button Text Hover', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_alt_button_text_hover]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_product_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Products', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_product_title_color]', array(
|
||||
'default' => $defaults['wc_product_title_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_product_title_color]',
|
||||
array(
|
||||
'label' => __( 'Product Title', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_product_title_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_product_title_color_hover]', array(
|
||||
'default' => $defaults['wc_product_title_color_hover'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_product_title_color_hover]',
|
||||
array(
|
||||
'label' => __( 'Product Title Hover', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_product_title_color_hover]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_rating_stars]',
|
||||
array(
|
||||
'default' => $defaults['wc_rating_stars'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => '',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_rating_stars]',
|
||||
array(
|
||||
'label' => __( 'Star Ratings', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_rating_stars]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_sale_sticker_background]',
|
||||
array(
|
||||
'default' => $defaults['wc_sale_sticker_background'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_sale_sticker_background]',
|
||||
array(
|
||||
'label' => __( 'Sale Sticker Background', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_sale_sticker_background]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_sale_sticker_text]', array(
|
||||
'default' => $defaults['wc_sale_sticker_text'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_sale_sticker_text]',
|
||||
array(
|
||||
'label' => __( 'Sale Sticker Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_sale_sticker_text]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_price_color]', array(
|
||||
'default' => $defaults['wc_price_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_price_color]',
|
||||
array(
|
||||
'label' => __( 'Price', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_price_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_panel_cart_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Sticky Panel Cart', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_panel_cart_background_color]',
|
||||
array(
|
||||
'default' => $defaults['wc_panel_cart_background_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_panel_cart_background_color]',
|
||||
array(
|
||||
'label' => __( 'Background Color', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_panel_cart_background_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_panel_cart_text_color]', array(
|
||||
'default' => $defaults['wc_panel_cart_text_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_panel_cart_text_color]',
|
||||
array(
|
||||
'label' => __( 'Text Color', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_panel_cart_text_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_panel_cart_button_background]', array(
|
||||
'default' => $defaults['wc_panel_cart_button_background'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_panel_cart_button_background]',
|
||||
array(
|
||||
'label' => __( 'Button Background', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_panel_cart_button_background]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_panel_cart_button_background_hover]', array(
|
||||
'default' => $defaults['wc_panel_cart_button_background_hover'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_panel_cart_button_background_hover]',
|
||||
array(
|
||||
'label' => __( 'Button Background Hover', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_panel_cart_button_background_hover]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_panel_cart_button_text]', array(
|
||||
'default' => $defaults['wc_panel_cart_button_text'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_panel_cart_button_text]',
|
||||
array(
|
||||
'label' => __( 'Button Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_panel_cart_button_text]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_panel_cart_button_text_hover]', array(
|
||||
'default' => $defaults['wc_panel_cart_button_text_hover'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_panel_cart_button_text_hover]',
|
||||
array(
|
||||
'label' => __( 'Button Text Hover', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_panel_cart_button_text_hover]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_mini_cart_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Menu Mini Cart', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_mini_cart_background_color]',
|
||||
array(
|
||||
'default' => $defaults['wc_mini_cart_background_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_mini_cart_background_color]',
|
||||
array(
|
||||
'label' => __( 'Cart Background Color', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_mini_cart_background_color]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_mini_cart_text_color]', array(
|
||||
'default' => $defaults['wc_mini_cart_text_color'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_mini_cart_text_color]',
|
||||
array(
|
||||
'label' => __( 'Cart Text Color', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_mini_cart_text_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_mini_cart_button_background]', array(
|
||||
'default' => $defaults['wc_mini_cart_button_background'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_mini_cart_button_background]',
|
||||
array(
|
||||
'label' => __( 'Button Background', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_mini_cart_button_background]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_mini_cart_button_background_hover]', array(
|
||||
'default' => $defaults['wc_mini_cart_button_background_hover'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_mini_cart_button_background_hover]',
|
||||
array(
|
||||
'label' => __( 'Button Background Hover', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_mini_cart_button_background_hover]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_mini_cart_button_text]', array(
|
||||
'default' => $defaults['wc_mini_cart_button_text'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_mini_cart_button_text]',
|
||||
array(
|
||||
'label' => __( 'Button Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_mini_cart_button_text]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_mini_cart_button_text_hover]', array(
|
||||
'default' => $defaults['wc_mini_cart_button_text_hover'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_mini_cart_button_text_hover]',
|
||||
array(
|
||||
'label' => __( 'Button Text Hover', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_mini_cart_button_text_hover]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_price_slider_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Price Slider Widget', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_price_slider_background_color]', array(
|
||||
'default' => $defaults['wc_price_slider_background_color'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_price_slider_background_color]',
|
||||
array(
|
||||
'label' => __( 'Slider Background Color', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_price_slider_background_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_price_slider_bar_color]', array(
|
||||
'default' => $defaults['wc_price_slider_bar_color'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_price_slider_bar_color]',
|
||||
array(
|
||||
'label' => __( 'Slider Bar Color', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_price_slider_bar_color]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_product_tabs_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Product Tabs', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_product_tab]', array(
|
||||
'default' => $defaults['wc_product_tab'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_product_tab]',
|
||||
array(
|
||||
'label' => __( 'Product Tab Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_product_tab]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_product_tab_highlight]', array(
|
||||
'default' => $defaults['wc_product_tab_highlight'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_product_tab_highlight]',
|
||||
array(
|
||||
'label' => __( 'Product Tab Active', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_product_tab_highlight]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Title_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_woocommerce_messages_title',
|
||||
array(
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'type' => 'generatepress-customizer-title',
|
||||
'title' => __( 'Messages', 'gp-premium' ),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_success_message_background]',
|
||||
array(
|
||||
'default' => $defaults['wc_success_message_background'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_success_message_background]',
|
||||
array(
|
||||
'label' => __( 'Success Message Background', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_success_message_background]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_success_message_text]', array(
|
||||
'default' => $defaults['wc_success_message_text'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_success_message_text]',
|
||||
array(
|
||||
'label' => __( 'Success Message Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_success_message_text]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_info_message_background]',
|
||||
array(
|
||||
'default' => $defaults['wc_info_message_background'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_info_message_background]',
|
||||
array(
|
||||
'label' => __( 'Info Message Background', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_info_message_background]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_info_message_text]', array(
|
||||
'default' => $defaults['wc_info_message_text'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_info_message_text]',
|
||||
array(
|
||||
'label' => __( 'Info Message Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_info_message_text]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_error_message_background]',
|
||||
array(
|
||||
'default' => $defaults['wc_error_message_background'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_rgba',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Alpha_Color_Customize_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_error_message_background]',
|
||||
array(
|
||||
'label' => __( 'Error Message Background', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_error_message_background]',
|
||||
'palette' => $palettes,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_settings[wc_error_message_text]', array(
|
||||
'default' => $defaults['wc_error_message_text'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
new WP_Customize_Color_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[wc_error_message_text]',
|
||||
array(
|
||||
'label' => __( 'Error Message Text', 'gp-premium' ),
|
||||
'section' => 'generate_woocommerce_colors',
|
||||
'settings' => 'generate_settings[wc_error_message_text]',
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
}
|
19
wp-content/plugins/gp-premium/colors/generate-colors.php
Normal file
19
wp-content/plugins/gp-premium/colors/generate-colors.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/*
|
||||
Addon Name: Generate Colors
|
||||
Author: Thomas Usborne
|
||||
Author URI: http://edge22.com
|
||||
*/
|
||||
|
||||
// No direct access, please
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define the version
|
||||
if ( ! defined( 'GENERATE_COLORS_VERSION' ) ) {
|
||||
define( 'GENERATE_COLORS_VERSION', GP_PREMIUM_VERSION );
|
||||
}
|
||||
|
||||
// Include functions identical between standalone addon and GP Premium
|
||||
require plugin_dir_path( __FILE__ ) . 'functions/functions.php';
|
Reference in New Issue
Block a user