mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-21 04:11:59 +08:00
Resolve merge conflcit
This commit is contained in:
commit
3069cf9cff
56 changed files with 4708 additions and 4736 deletions
|
@ -46,6 +46,8 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
'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',
|
||||
|
@ -228,6 +230,38 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
'priority' => 40,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Hero Heading Color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_hero_heading_color', array(
|
||||
'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' ),
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Hero Text Color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_hero_text_color', array(
|
||||
'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' ),
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_control( new Arbitrary_Storefront_Control( $wp_customize, 'storefront_header_image_heading', array(
|
||||
'section' => 'header_image',
|
||||
'type' => 'heading',
|
||||
|
@ -455,11 +489,25 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
'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',
|
||||
) );
|
||||
|
||||
$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,
|
||||
) );
|
||||
|
||||
$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,
|
||||
) );
|
||||
|
||||
/**
|
||||
|
@ -494,6 +542,8 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
$storefront_theme_mods = array(
|
||||
'background_color' => storefront_get_content_background_color(),
|
||||
'accent_color' => get_theme_mod( 'storefront_accent_color' ),
|
||||
'hero_heading_color' => get_theme_mod( 'storefront_hero_heading_color' ),
|
||||
'hero_text_color' => get_theme_mod( 'storefront_hero_text_color' ),
|
||||
'header_background_color' => get_theme_mod( 'storefront_header_background_color' ),
|
||||
'header_link_color' => get_theme_mod( 'storefront_header_link_color' ),
|
||||
'header_text_color' => get_theme_mod( 'storefront_header_text_color' ),
|
||||
|
@ -679,6 +729,14 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
color: ' . $storefront_theme_mods['footer_heading_color'] . ';
|
||||
}
|
||||
|
||||
.page-template-template-homepage.has-post-thumbnail .type-page.has-post-thumbnail .entry-title {
|
||||
color: ' . $storefront_theme_mods['hero_heading_color'] . ';
|
||||
}
|
||||
|
||||
.page-template-template-homepage.has-post-thumbnail .type-page.has-post-thumbnail .entry-content {
|
||||
color: ' . $storefront_theme_mods['hero_text_color'] . ';
|
||||
}
|
||||
|
||||
#order_review {
|
||||
background-color: ' . $storefront_theme_mods['background_color'] . ';
|
||||
}
|
||||
|
@ -728,6 +786,18 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
}';
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Storefront_Sticky_Add_to_Cart' ) ) {
|
||||
$styles .= '
|
||||
.storefront-sticky-add-to-cart {
|
||||
color: ' . $storefront_theme_mods['text_color'] . ';
|
||||
background-color: ' . $storefront_theme_mods['background_color'] . ';
|
||||
}
|
||||
|
||||
.storefront-sticky-add-to-cart a:not(.button) {
|
||||
color: ' . $storefront_theme_mods['header_link_color'] . ';
|
||||
}';
|
||||
}
|
||||
|
||||
return apply_filters( 'storefront_customizer_css', $styles );
|
||||
}
|
||||
|
||||
|
@ -961,6 +1031,22 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
public function get_site_description() {
|
||||
return get_bloginfo( 'description', 'display' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current page is using the Homepage template.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @return bool
|
||||
*/
|
||||
public function is_homepage_template() {
|
||||
$template = get_post_meta( get_the_ID(), '_wp_page_template', true );
|
||||
|
||||
if ( ! $template || 'template-homepage.php' !== $template || ! has_post_thumbnail( get_the_ID() ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue