Fix merge conflict

This commit is contained in:
Tiago Noronha 2018-11-22 16:55:19 +00:00
commit efe46e8cc6
17 changed files with 712 additions and 540 deletions

View file

@ -1,76 +1,187 @@
/**
* WooCommerce AJAX Layered Nav
* WooCommerce Product Bundles
*/
/**
* Imports
*/
@import 'bourbon';
@import '../../sass/utils/variables';
@import '../../sass/utils/mixins';
@import '../../../../node_modules/susy/sass/susy';
@import '../../sass/vendors/modular-scale';
/**
* Base
*/
.bundle_form {
div.bundled_product_summary {
padding-bottom: ms(3) !important;
margin-bottom: ms(3);
border-bottom: 1px solid $color_border;
padding-left: 0;
.bundled_product_images {
margin-left: 0;
a {
margin: 0 !important;
}
img {
width: 100% !important;
margin-bottom: 0;
}
}
}
div.bundled_product_summary, tr.bundled_product_summary {
.details {
font-size: ms(-1);
}
}
}
.woocommerce, .woocommerce-page {
#content div.product, div.product {
.bundle_form div.bundled_product_summary .bundled_product_images {
@include span( 2 of 10 );
}
}
}
.bundle_form {
div.bundled_product_summary:not( .thumbnail_hidden ) {
.details {
@include span( last 8 of 10 );
}
}
}
.bundle_form {
div.bundled_product_summary:not( .thumbnail_hidden ) {
.details {
padding: 0 !important;
}
}
}
.bundled_table_item {
.product-name {
padding-left: 4rem;
}
}
/**
* Desktop
*/
@include susy-media($desktop) {
.bundle_form {
div.bundled_product_summary {
padding-left: 0;
.bundled_product_images {
margin-left: 0;
@include span( 2 of 10 );
a {
margin: 0 !important;
.bundle_table_item dl.bundle_configuration {
display: none;
}
.sp-product-gallery-stacked, .storefront-full-width-content, .page-template-template-fullwidth-php {
.bundle_form {
.bundled_product_summary {
.details {
font-size: 1em;
}
img {
width: 100% !important;
}
}
.details {
@include span( last 8 of 10 );
font-size: ms(-1);
}
}
div.bundled_product_summary.thumbnail_hidden {
padding-left: 0;
}
.sp-product-gallery-stacked, .storefront-full-width-content, .page-template-template-fullwidth-php {
#content div.product, div.product {
.bundle_form div.bundled_product_summary .bundled_product_images {
@include span( 2 of 8 );
}
}
.bundle_form {
div.bundled_product_summary:not( .thumbnail_hidden ) {
.details {
@include span( last 6 of 8 );
}
}
}
}
}
/**
* Handheld
*/
@include susy-media(max-width $handheld) {
.woocommerce, .woocommerce-page {
#content div.product, div.product {
.bundle_form div.bundled_product_summary .bundled_product_images {
@include span( 10 of 10 );
}
}
}
.bundle_form {
div.bundled_product_summary:not( .thumbnail_hidden ) {
.details {
@include span( 10 of 10 );
}
}
}
.page-template-template-fullwidth-php,
.storefront-full-width-content {
.bundle_form {
div.bundled_product_summary {
padding-left: 0;
.bundled_product_images {
margin-left: 0;
@include span( 2 of 8 );
}
table.shop_table_responsive tr.bundled_table_item {
display: none;
}
.details {
@include span( last 6 of 8 );
font-size: 1em;
}
.bundle_form {
div.bundled_product_summary .bundled_product_images {
max-width: 50%;
}
div.bundled_product_summary .bundled_product_images {
img {
margin-bottom: 1em;
}
div.bundled_product_summary.thumbnail_hidden {
padding-left: 0;
.details {
@include span( 8 of 8 );
}
}
table.bundled_products td {
display: block;
}
table.bundled_products thead {
display: none;
}
table.bundled_products tr td.bundled_item_images_col {
width: 100%;
padding-bottom: 0;
}
table.bundled_products tr {
td.bundled_item_images_col, td.bundled_item_details_col {
padding-bottom: 0;
}
td.bundled_item_images_col {
width: 100%;
}
}
table.bundled_products tr td.bundled_item_qty_col {
max-width: 100%;
text-align: left;
}
}
}

View file

@ -5,12 +5,17 @@
/**
* Imports
*/
@import 'bourbon';
@import '../../sass/utils/variables';
@import '../../sass/utils/mixins';
@import '../../../../node_modules/susy/sass/susy';
@import '../../sass/vendors/modular-scale';
/**
* Base
*/
.composite_summary .summary_element {
.summary_element_wrapper {
@ -32,6 +37,179 @@
}
}
.composite_form {
.component {
.component_summary {
.content {
margin-bottom: ms(3);
}
.composited_product_details_wrapper {
padding-left: 0;
.composited_product_images {
margin-left: 0;
a {
margin: 0 !important;
}
img {
width: 100%;
height: auto;
margin-bottom: 0;
}
}
}
}
&:not( .selection_thumbnail_hidden ) .component_summary {
.composited_product_details_wrapper {
.details {
padding: 0;
}
}
}
.component_option_thumbnails {
.component_option_thumbnail {
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0 );
&.selected,
&.selected:hover {
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0.06 );
}
&:hover {
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0.03 );
}
&.disabled,
&.disabled:hover {
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0 );
}
}
}
.select_label {
display: block;
margin-bottom: 1em;
}
}
}
.woocommerce, .woocommerce-page {
#content div.product, div.product {
.component .composited_product_images {
@include span( 2 of 10 );
}
}
}
.composite_form {
.component {
&:not( .selection_thumbnail_hidden ) .component_summary {
.composited_product_details_wrapper {
.details {
@include span( last 8 of 10 );
}
}
}
}
}
.component_table_item {
.product-name {
padding-left: 4rem;
}
}
/**
* Desktop
*/
@include susy-media($desktop) {
.component_container_table_item dl.composite_configuration {
display: none;
}
.sp-product-gallery-stacked, .storefront-full-width-content, .page-template-template-fullwidth-php {
#content div.product, div.product {
.component .composited_product_images {
@include span( 2 of 8 );
}
}
.composite_form {
.component {
&:not( .selection_thumbnail_hidden ) .component_summary {
.composited_product_details_wrapper {
.details {
@include span( last 6 of 8 );
}
}
}
}
}
}
}
/**
* Handheld
*/
@include susy-media(max-width $handheld) {
table.shop_table_responsive tr.component_table_item {
display: none;
}
.woocommerce, .woocommerce-page {
#content div.product, div.product {
.component .composited_product_images {
@include span( 10 of 10 );
}
}
}
.composite_form {
.component {
&:not( .selection_thumbnail_hidden ) .component_summary {
.composited_product_details_wrapper {
.details {
@include span( 10 of 10 );
}
}
}
.component_summary {
.composited_product_details_wrapper {
.composited_product_images {
max-width: 50%;
img {
margin-bottom: 1em;
}
}
}
}
}
}
}
/**
* Widget
*/
.widget.widget_composite_summary.widget_position_fixed {
font-size: ms(1);
}
@ -102,166 +280,3 @@
float: left;
}
}
.single-product div.product {
.selection_thumbnail_hidden .component_selections .component_summary {
.component_data {
@include span(12 of 12);
}
}
.component_selections {
.component_summary {
border-bottom: 1px solid $color_border;
.content {
margin-bottom: ms(3);
}
.composited_product_details_wrapper {
padding-left: 0;
}
.composited_product_images {
margin-left: 0;
@include span(3 of 12);
a {
padding-right: 0;
}
img {
width: 100%;
height: auto;
}
}
.component_data {
@include span(last 9 of 12);
margin-left: 0;
}
}
> div {
padding-left: 0;
}
.select_label {
display: block;
margin-bottom: 1em;
}
.component_option_thumbnails {
.component_option_thumbnail {
margin-left: 5px; /* v2.5.5 compat */
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0 );
&.selected,
&.selected:hover {
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0.06 );
}
&:hover {
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0.03 );
}
&.disabled,
&.disabled:hover {
box-shadow: 0 0 0 4px rgba( 0, 0, 0, 0 );
}
}
}
}
.component.progressive .component_summary {
border-bottom: none;
}
}
.storefront-full-width-content {
&.single-product div.product {
.selection_thumbnail_hidden .component_selections .component_summary {
.component_data {
@include span(12 of 12);
}
}
.component_selections {
.component_summary {
.composited_product_images {
@include span(3 of 12);
a {
padding-right: 0;
}
}
.component_data {
@include span(last 9 of 12);
margin-left: 0;
}
}
}
}
}
.swc-product-gallery-stacked,
.swc-product-gallery-hidden {
&.single-product div.product {
.selection_thumbnail_hidden .component_selections .component_summary {
.component_data {
@include span(12 of 12);
}
}
.component_selections {
.component_summary {
.composited_product_images {
@include span(3 of 12);
a {
padding-right: 0;
}
}
.component_data {
@include span(last 9 of 12);
}
}
}
}
&.storefront-full-width-content {
&.single-product div.product {
.selection_thumbnail_hidden .component_selections .component_summary {
.component_data {
@include span(12 of 12);
}
}
.component_selections {
.component_summary {
.composited_product_images {
@include span(3 of 12);
a {
padding-right: 0;
}
}
.component_data {
@include span(last 9 of 12);
}
}
}
}
}
}

View file

@ -65,7 +65,7 @@ if ( post_password_required() ) {
endif;
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
if ( ! comments_open() && 0 !== get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'storefront' ); ?></p>
<?php

View file

@ -19,7 +19,7 @@ if ( ! isset( $content_width ) ) {
}
$storefront = (object) array(
'version' => $storefront_version,
'version' => $storefront_version,
/**
* Initialize all the things.

View file

@ -58,9 +58,9 @@ if ( ! class_exists( 'Storefront_Admin' ) ) :
* @since 1.0.0
*/
public function storefront_welcome_screen() {
require_once( ABSPATH . 'wp-load.php' );
require_once( ABSPATH . 'wp-admin/admin.php' );
require_once( ABSPATH . 'wp-admin/admin-header.php' );
require_once ABSPATH . 'wp-load.php';
require_once ABSPATH . 'wp-admin/admin.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
global $storefront_version;
?>
@ -156,7 +156,7 @@ if ( ! class_exists( 'Storefront_Admin' ) ) :
* @since 1.0.0
*/
public function welcome_intro() {
require_once( get_template_directory() . '/inc/admin/welcome-screen/component-intro.php' );
require_once get_template_directory() . '/inc/admin/welcome-screen/component-intro.php';
}
/**
@ -186,7 +186,7 @@ if ( ! class_exists( 'Storefront_Admin' ) ) :
);
} else {
// The plugin doesn't exist.
$url = wp_nonce_url(
$url = wp_nonce_url(
add_query_arg(
array(
'action' => 'install-plugin',
@ -237,7 +237,7 @@ if ( ! class_exists( 'Storefront_Admin' ) ) :
* @since 1.5.2
*/
public function welcome_enhance() {
require_once( get_template_directory() . '/inc/admin/welcome-screen/component-enhance.php' );
require_once get_template_directory() . '/inc/admin/welcome-screen/component-enhance.php';
}
/**
@ -246,7 +246,7 @@ if ( ! class_exists( 'Storefront_Admin' ) ) :
* @since 1.5.2
*/
public function welcome_contribute() {
require_once( get_template_directory() . '/inc/admin/welcome-screen/component-contribute.php' );
require_once get_template_directory() . '/inc/admin/welcome-screen/component-contribute.php';
}
/**

View file

@ -82,7 +82,7 @@ if ( ! class_exists( 'Storefront_Plugin_Install' ) ) :
}
} else {
// The plugin doesn't exist.
$url = wp_nonce_url(
$url = wp_nonce_url(
add_query_arg(
array(
'action' => 'install-plugin',

View file

@ -196,9 +196,9 @@ if ( ! class_exists( 'Storefront' ) ) :
*/
public function widgets_init() {
$sidebar_args['sidebar'] = array(
'name' => __( 'Sidebar', 'storefront' ),
'id' => 'sidebar-1',
'description' => '',
'name' => __( 'Sidebar', 'storefront' ),
'id' => 'sidebar-1',
'description' => '',
);
$sidebar_args['header'] = array(
@ -215,7 +215,7 @@ if ( ! class_exists( 'Storefront' ) ) :
$footer_n = $region + $regions * ( $row - 1 ); // Defines footer sidebar ID.
$footer = sprintf( 'footer_%d', $footer_n );
if ( 1 == $rows ) {
if ( 1 === $rows ) {
/* translators: 1: column number */
$footer_region_name = sprintf( __( 'Footer Column %1$d', 'storefront' ), $region );
@ -298,7 +298,7 @@ if ( ! class_exists( 'Storefront' ) ) :
$query_args = array(
'family' => implode( '|', $google_fonts ),
'subset' => urlencode( 'latin,latin-ext' ),
'subset' => rawurlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );

View file

@ -19,7 +19,7 @@ class Arbitrary_Storefront_Control extends WP_Customize_Control {
*
* @var string $settings the blog name.
*/
public $settings = 'blogname';
public $settings = 'blogname';
/**
* The description var

View file

@ -62,10 +62,10 @@ class Storefront_Custom_Radio_Image_Control extends WP_Customize_Control {
<div id="input_<?php echo esc_attr( $this->id ); ?>" class="image">
<?php foreach ( $this->choices as $value => $label ) : ?>
<input class="image-select" type="radio" value="<?php echo esc_attr( $value ); ?>" id="<?php echo esc_attr( $this->id . $value ); ?>" name="<?php echo esc_attr( $name ); ?>"
<?php
$this->link();
checked( $this->value(), $value );
?>
<?php
$this->link();
checked( $this->value(), $value );
?>
>
<label for="<?php echo esc_attr( $this->id ) . esc_attr( $value ); ?>">
<img src="<?php echo esc_html( $label ); ?>" alt="<?php echo esc_attr( $value ); ?>" title="<?php echo esc_attr( $value ); ?>">

View file

@ -39,24 +39,24 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
public static function get_storefront_default_setting_values() {
return apply_filters(
'storefront_setting_default_values', $args = array(
'storefront_heading_color' => '#333333',
'storefront_text_color' => '#6d6d6d',
'storefront_accent_color' => '#96588a',
'storefront_hero_heading_color' => '#000000',
'storefront_hero_text_color' => '#000000',
'storefront_header_background_color' => '#ffffff',
'storefront_header_text_color' => '#404040',
'storefront_header_link_color' => '#333333',
'storefront_footer_background_color' => '#f0f0f0',
'storefront_footer_heading_color' => '#333333',
'storefront_footer_text_color' => '#6d6d6d',
'storefront_footer_link_color' => '#333333',
'storefront_button_background_color' => '#eeeeee',
'storefront_button_text_color' => '#333333',
'storefront_heading_color' => '#333333',
'storefront_text_color' => '#6d6d6d',
'storefront_accent_color' => '#96588a',
'storefront_hero_heading_color' => '#000000',
'storefront_hero_text_color' => '#000000',
'storefront_header_background_color' => '#ffffff',
'storefront_header_text_color' => '#404040',
'storefront_header_link_color' => '#333333',
'storefront_footer_background_color' => '#f0f0f0',
'storefront_footer_heading_color' => '#333333',
'storefront_footer_text_color' => '#6d6d6d',
'storefront_footer_link_color' => '#333333',
'storefront_button_background_color' => '#eeeeee',
'storefront_button_text_color' => '#333333',
'storefront_button_alt_background_color' => '#333333',
'storefront_button_alt_text_color' => '#ffffff',
'storefront_layout' => 'right',
'background_color' => 'ffffff',
'storefront_button_alt_text_color' => '#ffffff',
'storefront_layout' => 'right',
'background_color' => 'ffffff',
)
);
}
@ -114,21 +114,21 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
public function customize_register( $wp_customize ) {
// Move background color setting alongside background image.
$wp_customize->get_control( 'background_color' )->section = 'background_image';
$wp_customize->get_control( 'background_color' )->priority = 20;
$wp_customize->get_control( 'background_color' )->section = 'background_image';
$wp_customize->get_control( 'background_color' )->priority = 20;
// Change background image section title & priority.
$wp_customize->get_section( 'background_image' )->title = __( 'Background', 'storefront' );
$wp_customize->get_section( 'background_image' )->priority = 30;
$wp_customize->get_section( 'background_image' )->title = __( 'Background', 'storefront' );
$wp_customize->get_section( 'background_image' )->priority = 30;
// Change header image section title & priority.
$wp_customize->get_section( 'header_image' )->title = __( 'Header', 'storefront' );
$wp_customize->get_section( 'header_image' )->priority = 25;
$wp_customize->get_section( 'header_image' )->title = __( 'Header', 'storefront' );
$wp_customize->get_section( 'header_image' )->priority = 25;
// Selective refresh.
if ( function_exists( 'add_partial' ) ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial(
'custom_logo', array(
@ -167,8 +167,8 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_section(
'storefront_typography', array(
'title' => __( 'Typography', 'storefront' ),
'priority' => 45,
'title' => __( 'Typography', 'storefront' ),
'priority' => 45,
)
);
@ -177,18 +177,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_heading_color', array(
'default' => apply_filters( 'storefront_default_heading_color', '#484c51' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_heading_color', '#484c51' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_heading_color', array(
'label' => __( 'Heading color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_heading_color',
'priority' => 20,
'label' => __( 'Heading color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_heading_color',
'priority' => 20,
)
)
);
@ -198,18 +198,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_text_color', array(
'default' => apply_filters( 'storefront_default_text_color', '#43454b' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_text_color', '#43454b' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_text_color', array(
'label' => __( 'Text color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_text_color',
'priority' => 30,
'label' => __( 'Text color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_text_color',
'priority' => 30,
)
)
);
@ -219,18 +219,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_accent_color', array(
'default' => apply_filters( 'storefront_default_accent_color', '#96588a' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_accent_color', '#96588a' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_accent_color', array(
'label' => __( 'Link / accent color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_accent_color',
'priority' => 40,
'label' => __( 'Link / accent color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_accent_color',
'priority' => 40,
)
)
);
@ -240,19 +240,19 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_hero_heading_color', array(
'default' => apply_filters( 'storefront_default_hero_heading_color', '#000000' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_hero_heading_color', '#000000' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_hero_heading_color', array(
'label' => __( 'Hero heading color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_hero_heading_color',
'priority' => 50,
'active_callback' => array( $this, 'is_homepage_template' ),
'label' => __( 'Hero heading color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_hero_heading_color',
'priority' => 50,
'active_callback' => array( $this, 'is_homepage_template' ),
)
)
);
@ -262,19 +262,19 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_hero_text_color', array(
'default' => apply_filters( 'storefront_default_hero_text_color', '#000000' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_hero_text_color', '#000000' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_hero_text_color', array(
'label' => __( 'Hero text color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_hero_text_color',
'priority' => 60,
'active_callback' => array( $this, 'is_homepage_template' ),
'label' => __( 'Hero text color', 'storefront' ),
'section' => 'storefront_typography',
'settings' => 'storefront_hero_text_color',
'priority' => 60,
'active_callback' => array( $this, 'is_homepage_template' ),
)
)
);
@ -282,10 +282,10 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
$wp_customize->add_control(
new Arbitrary_Storefront_Control(
$wp_customize, 'storefront_header_image_heading', array(
'section' => 'header_image',
'type' => 'heading',
'label' => __( 'Header background image', 'storefront' ),
'priority' => 6,
'section' => 'header_image',
'type' => 'heading',
'label' => __( 'Header background image', 'storefront' ),
'priority' => 6,
)
)
);
@ -295,18 +295,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_header_background_color', array(
'default' => apply_filters( 'storefront_default_header_background_color', '#2c2d33' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_header_background_color', '#2c2d33' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_header_background_color', array(
'label' => __( 'Background color', 'storefront' ),
'section' => 'header_image',
'settings' => 'storefront_header_background_color',
'priority' => 15,
'label' => __( 'Background color', 'storefront' ),
'section' => 'header_image',
'settings' => 'storefront_header_background_color',
'priority' => 15,
)
)
);
@ -316,18 +316,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_header_text_color', array(
'default' => apply_filters( 'storefront_default_header_text_color', '#9aa0a7' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_header_text_color', '#9aa0a7' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_header_text_color', array(
'label' => __( 'Text color', 'storefront' ),
'section' => 'header_image',
'settings' => 'storefront_header_text_color',
'priority' => 20,
'label' => __( 'Text color', 'storefront' ),
'section' => 'header_image',
'settings' => 'storefront_header_text_color',
'priority' => 20,
)
)
);
@ -337,18 +337,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_header_link_color', array(
'default' => apply_filters( 'storefront_default_header_link_color', '#d5d9db' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_header_link_color', '#d5d9db' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_header_link_color', array(
'label' => __( 'Link color', 'storefront' ),
'section' => 'header_image',
'settings' => 'storefront_header_link_color',
'priority' => 30,
'label' => __( 'Link color', 'storefront' ),
'section' => 'header_image',
'settings' => 'storefront_header_link_color',
'priority' => 30,
)
)
);
@ -358,9 +358,9 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_section(
'storefront_footer', array(
'title' => __( 'Footer', 'storefront' ),
'priority' => 28,
'description' => __( 'Customize the look & feel of your website footer.', 'storefront' ),
'title' => __( 'Footer', 'storefront' ),
'priority' => 28,
'description' => __( 'Customize the look & feel of your website footer.', 'storefront' ),
)
);
@ -369,18 +369,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_footer_background_color', array(
'default' => apply_filters( 'storefront_default_footer_background_color', '#f0f0f0' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_footer_background_color', '#f0f0f0' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_footer_background_color', array(
'label' => __( 'Background color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_background_color',
'priority' => 10,
'label' => __( 'Background color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_background_color',
'priority' => 10,
)
)
);
@ -390,18 +390,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_footer_heading_color', array(
'default' => apply_filters( 'storefront_default_footer_heading_color', '#494c50' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_footer_heading_color', '#494c50' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_footer_heading_color', array(
'label' => __( 'Heading color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_heading_color',
'priority' => 20,
'label' => __( 'Heading color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_heading_color',
'priority' => 20,
)
)
);
@ -411,18 +411,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_footer_text_color', array(
'default' => apply_filters( 'storefront_default_footer_text_color', '#61656b' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_footer_text_color', '#61656b' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_footer_text_color', array(
'label' => __( 'Text color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_text_color',
'priority' => 30,
'label' => __( 'Text color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_text_color',
'priority' => 30,
)
)
);
@ -432,18 +432,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_footer_link_color', array(
'default' => apply_filters( 'storefront_default_footer_link_color', '#2c2d33' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_footer_link_color', '#2c2d33' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_footer_link_color', array(
'label' => __( 'Link color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_link_color',
'priority' => 40,
'label' => __( 'Link color', 'storefront' ),
'section' => 'storefront_footer',
'settings' => 'storefront_footer_link_color',
'priority' => 40,
)
)
);
@ -453,9 +453,9 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_section(
'storefront_buttons', array(
'title' => __( 'Buttons', 'storefront' ),
'priority' => 45,
'description' => __( 'Customize the look & feel of your website buttons.', 'storefront' ),
'title' => __( 'Buttons', 'storefront' ),
'priority' => 45,
'description' => __( 'Customize the look & feel of your website buttons.', 'storefront' ),
)
);
@ -464,18 +464,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_button_background_color', array(
'default' => apply_filters( 'storefront_default_button_background_color', '#96588a' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_button_background_color', '#96588a' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_button_background_color', array(
'label' => __( 'Background color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_background_color',
'priority' => 10,
'label' => __( 'Background color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_background_color',
'priority' => 10,
)
)
);
@ -485,18 +485,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_button_text_color', array(
'default' => apply_filters( 'storefront_default_button_text_color', '#ffffff' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_button_text_color', '#ffffff' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_button_text_color', array(
'label' => __( 'Text color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_text_color',
'priority' => 20,
'label' => __( 'Text color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_text_color',
'priority' => 20,
)
)
);
@ -506,18 +506,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_button_alt_background_color', array(
'default' => apply_filters( 'storefront_default_button_alt_background_color', '#2c2d33' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_button_alt_background_color', '#2c2d33' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_button_alt_background_color', array(
'label' => __( 'Alternate button background color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_alt_background_color',
'priority' => 30,
'label' => __( 'Alternate button background color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_alt_background_color',
'priority' => 30,
)
)
);
@ -527,18 +527,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_setting(
'storefront_button_alt_text_color', array(
'default' => apply_filters( 'storefront_default_button_alt_text_color', '#ffffff' ),
'sanitize_callback' => 'sanitize_hex_color',
'default' => apply_filters( 'storefront_default_button_alt_text_color', '#ffffff' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize, 'storefront_button_alt_text_color', array(
'label' => __( 'Alternate button text color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_alt_text_color',
'priority' => 40,
'label' => __( 'Alternate button text color', 'storefront' ),
'section' => 'storefront_buttons',
'settings' => 'storefront_button_alt_text_color',
'priority' => 40,
)
)
);
@ -548,26 +548,26 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
*/
$wp_customize->add_section(
'storefront_layout', array(
'title' => __( 'Layout', 'storefront' ),
'priority' => 50,
'title' => __( 'Layout', 'storefront' ),
'priority' => 50,
)
);
$wp_customize->add_setting(
'storefront_layout', array(
'default' => apply_filters( 'storefront_default_layout', $layout = is_rtl() ? 'left' : 'right' ),
'sanitize_callback' => 'storefront_sanitize_choices',
'default' => apply_filters( 'storefront_default_layout', $layout = is_rtl() ? 'left' : 'right' ),
'sanitize_callback' => 'storefront_sanitize_choices',
)
);
$wp_customize->add_control(
new Storefront_Custom_Radio_Image_Control(
$wp_customize, 'storefront_layout', array(
'settings' => 'storefront_layout',
'section' => 'storefront_layout',
'label' => __( 'General Layout', 'storefront' ),
'priority' => 1,
'choices' => array(
'settings' => 'storefront_layout',
'section' => 'storefront_layout',
'label' => __( 'General Layout', 'storefront' ),
'priority' => 1,
'choices' => array(
'right' => get_template_directory_uri() . '/assets/images/customizer/controls/2cr.png',
'left' => get_template_directory_uri() . '/assets/images/customizer/controls/2cl.png',
),
@ -581,8 +581,8 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
if ( apply_filters( 'storefront_customizer_more', true ) ) {
$wp_customize->add_section(
'storefront_more', array(
'title' => __( 'More', 'storefront' ),
'priority' => 999,
'title' => __( 'More', 'storefront' ),
'priority' => 999,
)
);
@ -596,10 +596,10 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
$wp_customize->add_control(
new More_Storefront_Control(
$wp_customize, 'storefront_more', array(
'label' => __( 'Looking for more options?', 'storefront' ),
'section' => 'storefront_more',
'settings' => 'storefront_more',
'priority' => 1,
'label' => __( 'Looking for more options?', 'storefront' ),
'section' => 'storefront_more',
'settings' => 'storefront_more',
'priority' => 1,
)
)
);
@ -646,7 +646,7 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
$brighten_factor = apply_filters( 'storefront_brighten_factor', 25 );
$darken_factor = apply_filters( 'storefront_darken_factor', -25 );
$styles = '
$styles = '
.main-navigation ul li a,
.site-title a,
ul.menu li a,

View file

@ -142,7 +142,7 @@ if ( ! class_exists( 'Storefront_NUX_Admin' ) ) :
* @since 2.2.0
*/
public function dismiss_nux() {
if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'storefront_notice_dismiss' ) || ! current_user_can( 'manage_options' ) ) {
if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'storefront_notice_dismiss' ) || ! current_user_can( 'manage_options' ) ) { // WPCS: input var ok.
die();
}
@ -167,7 +167,7 @@ if ( ! class_exists( 'Storefront_NUX_Admin' ) ) :
$tasks = array();
if ( ! empty( $_REQUEST['homepage'] ) && 'on' === $_REQUEST['homepage'] ) {
if ( ! empty( $_REQUEST['homepage'] ) && 'on' === sanitize_text_field( wp_unslash( $_REQUEST['homepage'] ) ) ) { // WPCS: input var ok.
if ( current_user_can( 'edit_pages' ) && 'page' === get_option( 'show_on_front' ) ) {
$this->_assign_page_template( get_option( 'page_on_front' ), 'template-homepage.php' );
} else {
@ -175,7 +175,7 @@ if ( ! class_exists( 'Storefront_NUX_Admin' ) ) :
}
}
if ( ! empty( $_REQUEST['products'] ) && 'on' === $_REQUEST['products'] ) {
if ( ! empty( $_REQUEST['products'] ) && 'on' === sanitize_text_field( wp_unslash( $_REQUEST['products'] ) ) ) { // WPCS: input var ok.
$tasks[] = 'products';
}
@ -194,7 +194,7 @@ if ( ! class_exists( 'Storefront_NUX_Admin' ) ) :
}
// Redirect to the Storefront Welcome screen when exiting the Customizer.
$args['return'] = urlencode( admin_url( 'themes.php?page=storefront-welcome' ) );
$args['return'] = rawurlencode( admin_url( 'themes.php?page=storefront-welcome' ) );
wp_safe_redirect( add_query_arg( $args, admin_url( 'customize.php' ) ) );

View file

@ -32,7 +32,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
add_action( 'transition_post_status', array( $this, 'transition_post_status' ), 10, 3 );
add_filter( 'the_title', array( $this, 'filter_auto_draft_title' ), 10, 2 );
if ( ! isset( $_GET['sf_starter_content'] ) || 1 !== absint( $_GET['sf_starter_content'] ) ) {
if ( ! isset( $_GET['sf_starter_content'] ) || 1 !== absint( $_GET['sf_starter_content'] ) ) { // WPCS: input var ok.
add_filter( 'storefront_starter_content', '__return_empty_array' );
}
}
@ -58,40 +58,40 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
*/
public function starter_content() {
$starter_content = array(
'posts' => array(
'home' => array(
'posts' => array(
'home' => array(
'post_title' => esc_attr__( 'Welcome', 'storefront' ),
/* translators: %s: 'End Of Line' symbol */
'post_content' => sprintf( esc_attr__( 'This is your homepage which is what most visitors will see when they first visit your shop.%sYou can change this text by editing the "Welcome" page via the "Pages" menu in your dashboard.', 'storefront' ), PHP_EOL . PHP_EOL ),
'template' => 'template-homepage.php',
'thumbnail' => '{{hero-image}}',
),
'about' => array(
'post_type' => 'page',
'post_title' => __( 'About', 'storefront' ),
'about' => array(
'post_type' => 'page',
'post_title' => __( 'About', 'storefront' ),
'post_content' => __( 'You might be an artist who would like to introduce yourself and your work here or maybe you&rsquo;re a business with a mission to describe.', 'storefront' ),
),
'contact' => array(
'post_type' => 'page',
'post_title' => __( 'Contact', 'storefront' ),
'post_type' => 'page',
'post_title' => __( 'Contact', 'storefront' ),
'post_content' => __( 'This is a page with some basic contact information, such as an address and phone number. You might also try a plugin to add a contact form.', 'storefront' ),
),
'blog',
),
'attachments' => array(
'beanie-image' => array(
'beanie-image' => array(
'post_title' => 'Beanie',
'file' => 'assets/images/customizer/starter-content/products/beanie.jpg',
),
'belt-image' => array(
'belt-image' => array(
'post_title' => 'Belt',
'file' => 'assets/images/customizer/starter-content/products/belt.jpg',
),
'cap-image' => array(
'cap-image' => array(
'post_title' => 'Cap',
'file' => 'assets/images/customizer/starter-content/products/cap.jpg',
),
'hoodie-with-logo-image' => array(
'hoodie-with-logo-image' => array(
'post_title' => 'Hoodie with Logo',
'file' => 'assets/images/customizer/starter-content/products/hoodie-with-logo.jpg',
),
@ -103,53 +103,53 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'post_title' => 'Hoodie with Zipper',
'file' => 'assets/images/customizer/starter-content/products/hoodie-with-zipper.jpg',
),
'hoodie-image' => array(
'hoodie-image' => array(
'post_title' => 'Hoodie',
'file' => 'assets/images/customizer/starter-content/products/hoodie.jpg',
),
'long-sleeve-tee-image' => array(
'long-sleeve-tee-image' => array(
'post_title' => 'Long Sleeve Tee',
'file' => 'assets/images/customizer/starter-content/products/long-sleeve-tee.jpg',
),
'polo-image' => array(
'polo-image' => array(
'post_title' => 'Polo',
'file' => 'assets/images/customizer/starter-content/products/polo.jpg',
),
'sunglasses-image' => array(
'sunglasses-image' => array(
'post_title' => 'Sunglasses',
'file' => 'assets/images/customizer/starter-content/products/sunglasses.jpg',
),
'tshirt-image' => array(
'tshirt-image' => array(
'post_title' => 'Tshirt',
'file' => 'assets/images/customizer/starter-content/products/tshirt.jpg',
),
'vneck-tee-image' => array(
'vneck-tee-image' => array(
'post_title' => 'Vneck Tshirt',
'file' => 'assets/images/customizer/starter-content/products/vneck-tee.jpg',
),
'hero-image' => array(
'hero-image' => array(
'post_title' => 'Hero',
'file' => 'assets/images/customizer/starter-content/hero.jpg',
),
'accessories-image' => array(
'accessories-image' => array(
'post_title' => 'Accessories',
'file' => 'assets/images/customizer/starter-content/categories/accessories.jpg',
),
'tshirts-image' => array(
'tshirts-image' => array(
'post_title' => 'T-shirts',
'file' => 'assets/images/customizer/starter-content/categories/tshirts.jpg',
),
'hoodies-image' => array(
'hoodies-image' => array(
'post_title' => 'Hoodies',
'file' => 'assets/images/customizer/starter-content/categories/hoodies.jpg',
),
),
'options' => array(
'options' => array(
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
'page_for_posts' => '{{blog}}',
),
'widgets' => array(
'widgets' => array(
'footer-1' => array(
'text_about',
),
@ -157,29 +157,29 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'text_business_info',
),
),
'nav_menus' => array(
'primary' => array(
'name' => __( 'Primary Menu', 'storefront' ),
'nav_menus' => array(
'primary' => array(
'name' => __( 'Primary Menu', 'storefront' ),
'items' => array(
'shop' => array(
'shop' => array(
'type' => 'post_type',
'object' => 'page',
'object_id' => '{{sf_shop}}',
),
'page_about' => array(
'type' => 'post_type',
'object' => 'page',
'page_about' => array(
'type' => 'post_type',
'object' => 'page',
'object_id' => '{{about}}',
),
'page_contact' => array(
'type' => 'post_type',
'object' => 'page',
'type' => 'post_type',
'object' => 'page',
'object_id' => '{{contact}}',
),
),
),
'secondary' => array(
'name' => __( 'Secondary Menu', 'storefront' ),
'name' => __( 'Secondary Menu', 'storefront' ),
'items' => array(
'my_account' => array(
'type' => 'post_type',
@ -188,8 +188,8 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'handheld' => array(
'name' => __( 'Handheld Menu', 'storefront' ),
'handheld' => array(
'name' => __( 'Handheld Menu', 'storefront' ),
'items' => array(
'shop' => array(
'type' => 'post_type',
@ -246,14 +246,14 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
* @return array $content
*/
public function filter_start_content( $content, $config ) {
if ( ! isset( $_GET['sf_starter_content'] ) || 1 !== absint( $_GET['sf_starter_content'] ) ) {
if ( ! isset( $_GET['sf_starter_content'] ) || 1 !== absint( $_GET['sf_starter_content'] ) ) { // WPCS: input var ok.
return $content;
}
$tasks = array();
if ( isset( $_GET['sf_tasks'] ) && '' !== sanitize_text_field( wp_unslash( $_GET['sf_tasks'] ) ) ) {
$tasks = explode( ',', sanitize_text_field( wp_unslash( $_GET['sf_tasks'] ) ) );
if ( isset( $_GET['sf_tasks'] ) && '' !== sanitize_text_field( wp_unslash( $_GET['sf_tasks'] ) ) ) { // WPCS: input var ok.
$tasks = explode( ',', sanitize_text_field( wp_unslash( $_GET['sf_tasks'] ) ) ); // WPCS: input var ok.
}
$tasks = $this->_validate_tasks( $tasks );
@ -535,7 +535,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
// Get Categories.
$product_cats = get_terms(
'product_cat', array(
'fields' => 'ids',
'fields' => 'ids',
'hide_empty' => false,
)
);
@ -562,7 +562,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
* @param WP_Post $post Post data.
*/
public function transition_post_status( $new_status, $old_status, $post ) {
if ( 'publish' === $new_status && 'auto-draft' === $old_status && in_array( $post->post_type, array( 'product' ) ) ) {
if ( 'publish' === $new_status && 'auto-draft' === $old_status && in_array( $post->post_type, array( 'product' ), true ) ) {
$post_name = get_post_meta( $post->ID, '_customize_draft_post_name', true );
$starter_products = $this->_starter_content_products();
@ -593,7 +593,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
$post = get_post( $post_id );
if ( $post && 'auto-draft' === $post->post_status && in_array( $post->post_type, array( 'product' ) ) && 'AUTO-DRAFT' === $post->post_title ) {
if ( $post && 'auto-draft' === $post->post_status && in_array( $post->post_type, array( 'product' ), true ) && 'AUTO-DRAFT' === $post->post_title ) {
$post_name = get_post_meta( $post->ID, '_customize_draft_post_name', true );
$starter_products = $this->_starter_content_products();
@ -615,15 +615,15 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
$accessories_name = esc_attr__( 'Accessories', 'storefront' );
$accessories_description = esc_attr__( 'A short category description', 'storefront' );
$hoodies_name = esc_attr__( 'Hoodies', 'storefront' );
$hoodies_description = esc_attr__( 'A short category description', 'storefront' );
$hoodies_name = esc_attr__( 'Hoodies', 'storefront' );
$hoodies_description = esc_attr__( 'A short category description', 'storefront' );
$tshirts_name = esc_attr__( 'Tshirts', 'storefront' );
$tshirts_description = esc_attr__( 'A short category description', 'storefront' );
$tshirts_name = esc_attr__( 'Tshirts', 'storefront' );
$tshirts_description = esc_attr__( 'A short category description', 'storefront' );
$products = array(
// Accessories.
'beanie' => array(
'beanie' => array(
'post_title' => esc_attr__( 'Beanie', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -635,7 +635,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'sale_price' => '18',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $accessories_name,
@ -645,7 +645,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'belt' => array(
'belt' => array(
'post_title' => esc_attr__( 'Belt', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -657,7 +657,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'sale_price' => '55',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $accessories_name,
@ -667,7 +667,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'cap' => array(
'cap' => array(
'post_title' => esc_attr__( 'Cap', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -679,7 +679,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'sale_price' => '16',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $accessories_name,
@ -689,7 +689,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'sunglasses' => array(
'sunglasses' => array(
'post_title' => esc_attr__( 'Sunglasses', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -700,7 +700,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'price' => '90',
'featured' => true,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $accessories_name,
@ -710,7 +710,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'hoodie-with-logo' => array(
'hoodie-with-logo' => array(
'post_title' => esc_attr__( 'Hoodie with Logo', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -721,7 +721,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'price' => '45',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $hoodies_name,
@ -743,7 +743,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'sale_price' => '35',
'featured' => true,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $hoodies_name,
@ -764,7 +764,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'price' => '45',
'featured' => true,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $hoodies_name,
@ -774,7 +774,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'hoodie' => array(
'hoodie' => array(
'post_title' => esc_attr__( 'Hoodie', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -786,7 +786,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'sale_price' => '42',
'featured' => true,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $hoodies_name,
@ -796,7 +796,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'long-sleeve-tee' => array(
'long-sleeve-tee' => array(
'post_title' => esc_attr__( 'Long Sleeve Tee', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -807,7 +807,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'price' => '25',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $tshirts_name,
@ -817,7 +817,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'polo' => array(
'polo' => array(
'post_title' => esc_attr__( 'Polo', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -828,7 +828,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'price' => '20',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $tshirts_name,
@ -838,7 +838,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'tshirt' => array(
'tshirt' => array(
'post_title' => esc_attr__( 'Tshirt', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -849,7 +849,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'price' => '18',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $tshirts_name,
@ -859,7 +859,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
),
),
),
'vneck-tee' => array(
'vneck-tee' => array(
'post_title' => esc_attr__( 'Vneck Tshirt', 'storefront' ),
'post_content' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'post_type' => 'product',
@ -870,7 +870,7 @@ if ( ! class_exists( 'Storefront_NUX_Starter_Content' ) ) :
'price' => '18',
'featured' => false,
),
'taxonomy' => array(
'taxonomy' => array(
'product_cat' => array(
array(
'term' => $tshirts_name,

View file

@ -56,7 +56,7 @@ function storefront_get_content_background_color() {
$bg_color = str_replace( '#', '', get_theme_mod( 'background_color' ) );
if ( class_exists( 'Storefront_Powerpack' ) || class_exists( 'Storefront_Designer' ) ) {
if ( $content_bg_color && ( 'true' == $content_frame || 'frame' == $content_frame ) ) {
if ( $content_bg_color && ( 'true' === $content_frame || 'frame' === $content_frame ) ) {
$bg_color = str_replace( '#', '', $content_bg_color );
}
}
@ -129,28 +129,28 @@ function storefront_homepage_content_styles() {
*/
function storefront_adjust_color_brightness( $hex, $steps ) {
// Steps should be between -255 and 255. Negative = darker, positive = lighter.
$steps = max( -255, min( 255, $steps ) );
$steps = max( -255, min( 255, $steps ) );
// Format the hex color string.
$hex = str_replace( '#', '', $hex );
$hex = str_replace( '#', '', $hex );
if ( 3 == strlen( $hex ) ) {
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
if ( 3 === strlen( $hex ) ) {
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
}
// Get decimal values.
$r = hexdec( substr( $hex, 0, 2 ) );
$g = hexdec( substr( $hex, 2, 2 ) );
$b = hexdec( substr( $hex, 4, 2 ) );
$r = hexdec( substr( $hex, 0, 2 ) );
$g = hexdec( substr( $hex, 2, 2 ) );
$b = hexdec( substr( $hex, 4, 2 ) );
// Adjust number of steps and keep it inside 0 to 255.
$r = max( 0, min( 255, $r + $steps ) );
$g = max( 0, min( 255, $g + $steps ) );
$b = max( 0, min( 255, $b + $steps ) );
$r = max( 0, min( 255, $r + $steps ) );
$g = max( 0, min( 255, $g + $steps ) );
$b = max( 0, min( 255, $b + $steps ) );
$r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );
$g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );
$b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );
$r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );
$g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );
$b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );
return '#' . $r_hex . $g_hex . $b_hex;
}
@ -185,7 +185,7 @@ function storefront_sanitize_choices( $input, $setting ) {
* @since 1.5.0
*/
function storefront_sanitize_checkbox( $checked ) {
return ( ( isset( $checked ) && true == $checked ) ? true : false );
return ( ( isset( $checked ) && true === $checked ) ? true : false );
}
/**

View file

@ -13,7 +13,7 @@ if ( ! function_exists( 'storefront_display_comments' ) ) {
*/
function storefront_display_comments() {
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || '0' != get_comments_number() ) :
if ( comments_open() || 0 !== get_comments_number() ) :
comments_template();
endif;
}
@ -29,11 +29,11 @@ if ( ! function_exists( 'storefront_comment' ) ) {
* @since 1.0.0
*/
function storefront_comment( $comment, $args, $depth ) {
if ( 'div' == $args['style'] ) {
$tag = 'div';
if ( 'div' === $args['style'] ) {
$tag = 'div';
$add_below = 'comment';
} else {
$tag = 'li';
$tag = 'li';
$add_below = 'div-comment';
}
?>
@ -44,7 +44,7 @@ if ( ! function_exists( 'storefront_comment' ) ) {
<?php echo get_avatar( $comment, 128 ); ?>
<?php printf( wp_kses_post( '<cite class="fn">%s</cite>', 'storefront' ), get_comment_author_link() ); ?>
</div>
<?php if ( '0' == $comment->comment_approved ) : ?>
<?php if ( '0' === $comment->comment_approved ) : ?>
<em class="comment-awaiting-moderation"><?php esc_attr_e( 'Your comment is awaiting moderation.', 'storefront' ); ?></em>
<br />
<?php endif; ?>
@ -53,7 +53,7 @@ if ( ! function_exists( 'storefront_comment' ) ) {
<?php echo '<time datetime="' . get_comment_date( 'c' ) . '">' . get_comment_date() . '</time>'; ?>
</a>
</div>
<?php if ( 'div' != $args['style'] ) : ?>
<?php if ( 'div' !== $args['style'] ) : ?>
<div id="div-comment-<?php comment_ID(); ?>" class="comment-content">
<?php endif; ?>
<div class="comment-text">
@ -65,7 +65,7 @@ if ( ! function_exists( 'storefront_comment' ) ) {
array_merge(
$args, array(
'add_below' => $add_below,
'depth' => $depth,
'depth' => $depth,
'max_depth' => $args['max_depth'],
)
)
@ -74,7 +74,7 @@ if ( ! function_exists( 'storefront_comment' ) ) {
<?php edit_comment_link( __( 'Edit', 'storefront' ), ' ', '' ); ?>
</div>
</div>
<?php if ( 'div' != $args['style'] ) : ?>
<?php if ( 'div' !== $args['style'] ) : ?>
</div>
<?php endif; ?>
<?php
@ -105,27 +105,22 @@ if ( ! function_exists( 'storefront_footer_widgets' ) ) {
if ( isset( $columns ) ) :
?>
<div class=<?php echo '"footer-widgets row-' . esc_attr( $row ) . ' col-' . esc_attr( $columns ) . ' fix"'; ?>>
<?php
<?php
for ( $column = 1; $column <= $columns; $column++ ) :
$footer_n = $column + $regions * ( $row - 1 );
for ( $column = 1; $column <= $columns; $column++ ) :
$footer_n = $column + $regions * ( $row - 1 );
if ( is_active_sidebar( 'footer-' . esc_attr( $footer_n ) ) ) :
?>
<div class="block footer-widget-<?php echo esc_attr( $column ); ?>">
<?php dynamic_sidebar( 'footer-' . esc_attr( $footer_n ) ); ?>
</div>
<?php
endif;
endfor;
?>
</div><!-- .footer-widgets.row-<?php echo esc_attr( $row ); ?> -->
<?php
unset( $columns );
if ( is_active_sidebar( 'footer-' . esc_attr( $footer_n ) ) ) :
?>
<div class="block footer-widget-<?php echo esc_attr( $column ); ?>">
<?php dynamic_sidebar( 'footer-' . esc_attr( $footer_n ) ); ?>
</div>
<?php
endif;
endfor;
?>
</div><!-- .footer-widgets.row-<?php echo esc_attr( $row ); ?> -->
<?php
unset( $columns );
endif;
endfor;
}
@ -235,15 +230,15 @@ if ( ! function_exists( 'storefront_primary_navigation' ) ) {
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'container_class' => 'primary-navigation',
'theme_location' => 'primary',
'container_class' => 'primary-navigation',
)
);
wp_nav_menu(
array(
'theme_location' => 'handheld',
'container_class' => 'handheld-navigation',
'theme_location' => 'handheld',
'container_class' => 'handheld-navigation',
)
);
?>
@ -266,8 +261,8 @@ if ( ! function_exists( 'storefront_secondary_navigation' ) ) {
<?php
wp_nav_menu(
array(
'theme_location' => 'secondary',
'fallback_cb' => '',
'theme_location' => 'secondary',
'fallback_cb' => '',
)
);
?>
@ -365,7 +360,7 @@ if ( ! function_exists( 'storefront_post_header' ) ) {
storefront_post_meta();
the_title( '<h1 class="entry-title">', '</h1>' );
} else {
if ( 'post' == get_post_type() ) {
if ( 'post' === get_post_type() ) {
storefront_post_meta();
}

View file

@ -56,42 +56,42 @@ if ( ! class_exists( 'Storefront_WooCommerce_Customizer' ) ) :
*/
$wp_customize->add_section(
'storefront_single_product_page', array(
'title' => __( 'Product Page', 'storefront' ),
'priority' => 60,
'title' => __( 'Product Page', 'storefront' ),
'priority' => 60,
)
);
$wp_customize->add_setting(
'storefront_product_pagination', array(
'default' => apply_filters( 'storefront_default_product_pagination', true ),
'sanitize_callback' => 'wp_validate_boolean',
'default' => apply_filters( 'storefront_default_product_pagination', true ),
'sanitize_callback' => 'wp_validate_boolean',
)
);
$wp_customize->add_setting(
'storefront_sticky_add_to_cart', array(
'default' => apply_filters( 'storefront_default_sticky_add_to_cart', true ),
'sanitize_callback' => 'wp_validate_boolean',
'default' => apply_filters( 'storefront_default_sticky_add_to_cart', true ),
'sanitize_callback' => 'wp_validate_boolean',
)
);
$wp_customize->add_control(
'storefront_sticky_add_to_cart', array(
'type' => 'checkbox',
'section' => 'storefront_single_product_page',
'label' => __( 'Sticky Add-To-Cart', 'storefront' ),
'description' => __( 'A small content bar at the top of the browser window which includes relevant product information and an add-to-cart button. It slides into view once the standard add-to-cart button has scrolled out of view.', 'storefront' ),
'priority' => 10,
'type' => 'checkbox',
'section' => 'storefront_single_product_page',
'label' => __( 'Sticky Add-To-Cart', 'storefront' ),
'description' => __( 'A small content bar at the top of the browser window which includes relevant product information and an add-to-cart button. It slides into view once the standard add-to-cart button has scrolled out of view.', 'storefront' ),
'priority' => 10,
)
);
$wp_customize->add_control(
'storefront_product_pagination', array(
'type' => 'checkbox',
'section' => 'storefront_single_product_page',
'label' => __( 'Product Pagination', 'storefront' ),
'description' => __( 'Displays next and previous links on product pages. A product thumbnail is displayed with the title revealed on hover.', 'storefront' ),
'priority' => 20,
'type' => 'checkbox',
'section' => 'storefront_single_product_page',
'label' => __( 'Product Pagination', 'storefront' ),
'description' => __( 'Displays next and previous links on product pages. A product thumbnail is displayed with the title revealed on hover.', 'storefront' ),
'priority' => 20,
)
);
}
@ -108,7 +108,7 @@ if ( ! class_exists( 'Storefront_WooCommerce_Customizer' ) ) :
$brighten_factor = apply_filters( 'storefront_brighten_factor', 25 );
$darken_factor = apply_filters( 'storefront_darken_factor', -25 );
$styles = '
$styles = '
a.cart-contents,
.site-header-cart .widget_shopping_cart a {
color: ' . $storefront_theme_mods['header_link_color'] . ';

View file

@ -40,6 +40,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
}
// Integrations.
add_action( 'storefront_woocommerce_setup', array( $this, 'setup_integrations' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'woocommerce_integrations_scripts' ), 99 );
add_action( 'wp_enqueue_scripts', array( $this, 'add_customizer_css' ), 140 );
}
@ -74,6 +75,13 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
/**
* Add 'storefront_woocommerce_setup' action.
*
* @since 2.4.0
*/
do_action( 'storefront_woocommerce_setup' );
}
/**
@ -112,7 +120,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
$classes[] = 'woocommerce-active';
// Remove `no-wc-breadcrumb` body class.
$key = array_search( 'no-wc-breadcrumb', $classes );
$key = array_search( 'no-wc-breadcrumb', $classes, true );
if ( false !== $key ) {
unset( $classes[ $key ] );
@ -251,7 +259,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* Bookings
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Bookings' ) ) {
wp_enqueue_style( 'storefront-woocommerce-bookings-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/bookings.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-bookings-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/bookings.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-bookings-style', 'rtl', 'replace' );
}
@ -259,7 +267,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* Brands
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Brands' ) ) {
wp_enqueue_style( 'storefront-woocommerce-brands-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/brands.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-brands-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/brands.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-brands-style', 'rtl', 'replace' );
wp_enqueue_script( 'storefront-woocommerce-brands', get_template_directory_uri() . '/assets/js/woocommerce/extensions/brands' . $suffix . '.js', array(), $storefront_version, true );
@ -269,7 +277,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* Wishlists
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Wishlists_Wishlist' ) ) {
wp_enqueue_style( 'storefront-woocommerce-wishlists-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/wishlists.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-wishlists-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/wishlists.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-wishlists-style', 'rtl', 'replace' );
}
@ -277,7 +285,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* AJAX Layered Nav
*/
if ( $this->is_woocommerce_extension_activated( 'SOD_Widget_Ajax_Layered_Nav' ) ) {
wp_enqueue_style( 'storefront-woocommerce-ajax-layered-nav-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/ajax-layered-nav.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-ajax-layered-nav-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/ajax-layered-nav.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-ajax-layered-nav-style', 'rtl', 'replace' );
}
@ -285,7 +293,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* Variation Swatches
*/
if ( $this->is_woocommerce_extension_activated( 'WC_SwatchesPlugin' ) ) {
wp_enqueue_style( 'storefront-woocommerce-variation-swatches-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/variation-swatches.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-variation-swatches-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/variation-swatches.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-variation-swatches-style', 'rtl', 'replace' );
}
@ -293,7 +301,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* Composite Products
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Composite_Products' ) ) {
wp_enqueue_style( 'storefront-woocommerce-composite-products-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/composite-products.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-composite-products-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/composite-products.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-composite-products-style', 'rtl', 'replace' );
}
@ -301,7 +309,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Photography
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Photography' ) ) {
wp_enqueue_style( 'storefront-woocommerce-photography-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/photography.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-photography-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/photography.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-photography-style', 'rtl', 'replace' );
}
@ -309,7 +317,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* Product Reviews Pro
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Product_Reviews_Pro' ) ) {
wp_enqueue_style( 'storefront-woocommerce-product-reviews-pro-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/product-reviews-pro.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-product-reviews-pro-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/product-reviews-pro.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-product-reviews-pro-style', 'rtl', 'replace' );
}
@ -317,7 +325,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Smart Coupons
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Smart_Coupons' ) ) {
wp_enqueue_style( 'storefront-woocommerce-smart-coupons-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/smart-coupons.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-smart-coupons-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/smart-coupons.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-smart-coupons-style', 'rtl', 'replace' );
}
@ -325,7 +333,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Deposits
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Deposits' ) ) {
wp_enqueue_style( 'storefront-woocommerce-deposits-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/deposits.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-deposits-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/deposits.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-deposits-style', 'rtl', 'replace' );
}
@ -333,7 +341,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Product Bundles
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Bundles' ) ) {
wp_enqueue_style( 'storefront-woocommerce-bundles-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/bundles.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-bundles-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/bundles.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-bundles-style', 'rtl', 'replace' );
}
@ -341,7 +349,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Multiple Shipping Addresses
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Ship_Multiple' ) ) {
wp_enqueue_style( 'storefront-woocommerce-sma-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/ship-multiple-addresses.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-sma-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/ship-multiple-addresses.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-sma-style', 'rtl', 'replace' );
}
@ -349,7 +357,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Advanced Product Labels
*/
if ( $this->is_woocommerce_extension_activated( 'Woocommerce_Advanced_Product_Labels' ) ) {
wp_enqueue_style( 'storefront-woocommerce-apl-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/advanced-product-labels.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-apl-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/advanced-product-labels.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-apl-style', 'rtl', 'replace' );
}
@ -357,7 +365,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Mix and Match
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Mix_and_Match' ) ) {
wp_enqueue_style( 'storefront-woocommerce-mix-and-match-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/mix-and-match.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-mix-and-match-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/mix-and-match.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-mix-and-match-style', 'rtl', 'replace' );
}
@ -365,7 +373,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Memberships
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Memberships' ) ) {
wp_enqueue_style( 'storefront-woocommerce-memberships-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/memberships.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-memberships-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/memberships.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-memberships-style', 'rtl', 'replace' );
}
@ -373,7 +381,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* WooCommerce Quick View
*/
if ( $this->is_woocommerce_extension_activated( 'WC_Quick_View' ) ) {
wp_enqueue_style( 'storefront-woocommerce-quick-view-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/quick-view.css', 'storefront-woocommerce-style' );
wp_enqueue_style( 'storefront-woocommerce-quick-view-style', get_template_directory_uri() . '/assets/css/woocommerce/extensions/quick-view.css', 'storefront-woocommerce-style', $storefront_version );
wp_style_add_data( 'storefront-woocommerce-quick-view-style', 'rtl', 'replace' );
}
@ -392,13 +400,14 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
* @return array $styles the css
*/
public function get_woocommerce_extension_css() {
$storefront_customizer = new Storefront_Customizer();
$storefront_theme_mods = $storefront_customizer->get_storefront_theme_mods();
global $storefront;
$woocommerce_extension_style = '';
$storefront_theme_mods = $storefront->customizer->get_storefront_theme_mods();
$woocommerce_extension_style = '';
if ( $this->is_woocommerce_extension_activated( 'WC_Bookings' ) ) {
$woocommerce_extension_style .= '
$woocommerce_extension_style .= '
.wc-bookings-date-picker .ui-datepicker td.bookable a {
background-color: ' . $storefront_theme_mods['accent_color'] . ' !important;
}
@ -414,7 +423,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
}
if ( $this->is_woocommerce_extension_activated( 'WC_Product_Reviews_Pro' ) ) {
$woocommerce_extension_style .= '
$woocommerce_extension_style .= '
.woocommerce #reviews .product-rating .product-rating-details table td.rating-graph .bar,
.woocommerce-page #reviews .product-rating .product-rating-details table td.rating-graph .bar {
background-color: ' . $storefront_theme_mods['text_color'] . ' !important;
@ -440,7 +449,7 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
}
if ( $this->is_woocommerce_extension_activated( 'WC_Smart_Coupons' ) ) {
$woocommerce_extension_style .= '
$woocommerce_extension_style .= '
.coupon-container {
background-color: ' . $storefront_theme_mods['button_background_color'] . ' !important;
}
@ -458,6 +467,48 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
return apply_filters( 'storefront_customizer_woocommerce_extension_css', $woocommerce_extension_style );
}
/*
|--------------------------------------------------------------------------
| Integrations.
|--------------------------------------------------------------------------
*/
/**
* Sets up integrations.
*
* @since 2.3.4
*
* @return void
*/
public function setup_integrations() {
if ( $this->is_woocommerce_extension_activated( 'WC_Bundles' ) ) {
add_filter( 'woocommerce_bundled_table_item_js_enqueued', '__return_true' );
add_filter( 'woocommerce_bundles_group_mode_options_data', array( $this, 'bundles_group_mode_options_data' ) );
}
if ( $this->is_woocommerce_extension_activated( 'WC_Composite_Products' ) ) {
add_filter( 'woocommerce_composited_table_item_js_enqueued', '__return_true' );
add_filter( 'woocommerce_display_composite_container_cart_item_data', '__return_true' );
}
}
/**
* Add "Includes" meta to parent cart items.
* Displayed only on handheld/mobile screens.
*
* @since 2.3.4
*
* @param array $group_mode_data
* @return array
*/
public function bundles_group_mode_options_data( $group_mode_data ) {
$group_mode_data[ 'parent' ][ 'features' ][] = 'parent_cart_item_meta';
return $group_mode_data;
}
}
endif;

View file

@ -252,11 +252,11 @@ if ( ! function_exists( 'storefront_product_categories' ) ) {
function storefront_product_categories( $args ) {
$args = apply_filters(
'storefront_product_categories_args', array(
'limit' => 3,
'columns' => 3,
'child_categories' => 0,
'orderby' => 'name',
'title' => __( 'Shop by Category', 'storefront' ),
'limit' => 3,
'columns' => 3,
'child_categories' => 0,
'orderby' => 'name',
'title' => __( 'Shop by Category', 'storefront' ),
)
);