Skip to content

Commit

Permalink
Merge branch 'release/1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed Apr 24, 2019
2 parents bf039a4 + d232eb7 commit 42d0fae
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 37 deletions.
65 changes: 38 additions & 27 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,40 +85,51 @@

<?php else : ?>

<a href="#menu" id="mobile-menu-button">
<?php siteorigin_north_display_icon( 'menu' ) ?>
<?php if ( siteorigin_setting( 'responsive_menu_text' ) ) : ?>
<?php echo esc_html( siteorigin_setting( 'responsive_menu_text' ) ); ?>
<span class="screen-reader-text"><?php esc_html_e( 'Menu', 'siteorigin-north' ); ?></span>
<?php endif; ?>
</a>
<?php
$menu_id = ( wp_get_nav_menu_name( 'primary' ) ? wp_get_nav_menu_name( 'primary' ) : false );
if ( class_exists( 'Woocommerce' ) ) {
// Work out if the WooCommerce cart is enabled and showing
if ( ( ! ( is_cart() || is_checkout() ) && siteorigin_setting( 'woocommerce_display_cart' ) ) || ( ( is_cart() || is_checkout() ) && siteorigin_setting( 'woocommerce_display_checkout_cart' ) ) ) {
$show_mini_cart = true;
}
}

if ( ( $menu_id && wp_get_nav_menu_object( $menu_id )->count ) || siteorigin_setting( 'navigation_search' ) || isset( $show_mini_cart ) ) : ?>

<a href="#menu" id="mobile-menu-button">
<?php siteorigin_north_display_icon( 'menu' ) ?>
<?php if ( siteorigin_setting( 'responsive_menu_text' ) ) : ?>
<?php echo esc_html( siteorigin_setting( 'responsive_menu_text' ) ); ?>
<span class="screen-reader-text"><?php esc_html_e( 'Menu', 'siteorigin-north' ); ?></span>
<?php endif; ?>
</a>

<?php
endif;

wp_nav_menu( array(
'theme_location' => 'primary',
'menu_id' => 'primary-menu'
) );
?>

<?php endif; ?>

<?php if ( class_exists( 'Woocommerce' ) && ! ( function_exists( 'ubermenu' ) || function_exists( 'max_mega_menu_is_enabled' ) ) ) : ?>
<?php if ( ( ! ( is_cart() || is_checkout() ) && siteorigin_setting( 'woocommerce_display_cart' ) ) || ( ( is_cart() || is_checkout() ) && siteorigin_setting( 'woocommerce_display_checkout_cart' ) ) ) : ?>
<?php global $woocommerce; ?>
<ul class="shopping-cart">
<li>
<a class="shopping-cart-link" href="<?php echo esc_url( wc_get_cart_url() ); ?>">
<span class="screen-reader-text"><?php esc_html_e( 'View shopping cart', 'siteorigin-north' ); ?></span>
<span class="north-icon-cart"></span>
<span class="shopping-cart-text"><?php esc_html_e( ' View Cart ', 'siteorigin-north' ); ?></span>
<span class="shopping-cart-count"><?php echo WC()->cart->cart_contents_count;?></span>
</a>
<ul class="shopping-cart-dropdown" id="cart-drop">
<?php the_widget( 'WC_Widget_Cart' ); ?>
</ul>
</li>
</ul>
<?php endif; ?>
<?php
if ( isset( $show_mini_cart ) ) :
global $woocommerce;
?>
<ul class="shopping-cart">
<li>
<a class="shopping-cart-link" href="<?php echo esc_url( wc_get_cart_url() ); ?>">
<span class="screen-reader-text"><?php esc_html_e( 'View shopping cart', 'siteorigin-north' ); ?></span>
<span class="north-icon-cart"></span>
<span class="shopping-cart-text"><?php esc_html_e( ' View Cart ', 'siteorigin-north' ); ?></span>
<span class="shopping-cart-count"><?php echo WC()->cart->cart_contents_count;?></span>
</a>
<ul class="shopping-cart-dropdown" id="cart-drop">
<?php the_widget( 'WC_Widget_Cart' ); ?>
</ul>
</li>
</ul>
<?php endif; ?>
<?php endif; ?>

<?php if ( siteorigin_setting( 'navigation_search' ) && ! ( function_exists( 'ubermenu' ) || function_exists( 'max_mega_menu_is_enabled' ) ) ) : ?>
Expand Down
1 change: 1 addition & 0 deletions inc/settings.conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
'fonts_text_menu' => 'color__text_menu',
'fonts_text_menu_hover' => 'color__text_menu_hover',
'fonts_text_menu_current' => 'color__text_menu_current',
'fonts_field_background' => 'color__input-background',

// Header.
'masthead_background_color' => 'masthead__background_color',
Expand Down
13 changes: 10 additions & 3 deletions inc/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ function siteorigin_north_settings_init() {
'label' => __( 'Menu Text Current Color', 'siteorigin-north' ),
'live' => true,
),
'field_background' => array(
'type' => 'color',
'label' => __( 'Form Field Background Color', 'siteorigin-north' ),
'live' => true,
),
),
),

Expand Down Expand Up @@ -578,6 +583,7 @@ function siteorigin_north_settings_custom_css( $css ) {
border-color: ${branding_accent_dark};
}
input[type="text"],input[type="email"],input[type="url"],input[type="password"],input[type="search"],input[type="tel"],textarea {
background: ${fonts_field_background};
color: ${fonts_text_medium};
.font( ${fonts_details} );
}
Expand Down Expand Up @@ -658,12 +664,12 @@ function siteorigin_north_settings_custom_css( $css ) {
color: ${fonts_text_menu_hover};
}
#mobile-navigation {
.font( ${fonts_menu} );
background: .rgba( ${responsive_mobile_menu_background_color}, ${responsive_mobile_menu_background_opacity});
.font( ${fonts_menu} );
}
#mobile-navigation form input[type="search"] {
color: ${responsive_mobile_menu_text_color};
border-bottom: 1px solid ${responsive_mobile_menu_text_color};
color: ${responsive_mobile_menu_text_color};
}
#mobile-navigation form input[type="search"]::-webkit-input-placeholder {
color: .rgba( ${responsive_mobile_menu_text_color}, 0.7);
Expand Down Expand Up @@ -719,8 +725,8 @@ function siteorigin_north_settings_custom_css( $css ) {
#masthead {
background: ${masthead_background_color};
border-bottom: ${masthead_border_width} solid ${masthead_border_color};
padding: ${masthead_padding} 0;
margin-bottom: ${masthead_bottom_margin};
padding: ${masthead_padding} 0;
}
#masthead .site-branding .site-title,#masthead .site-branding .logo-site-title {
color: ${fonts_text_dark};
Expand Down Expand Up @@ -1170,6 +1176,7 @@ function siteorigin_north_settings_defaults( $defaults ) {
$defaults['fonts_text_menu'] = '#898989';
$defaults['fonts_text_menu_hover'] = '#595959';
$defaults['fonts_text_menu_current'] = '#292929';
$defaults['fonts_field_background'] = '#ffffff';

// Icon defaults.
$defaults['icons_menu'] = false;
Expand Down
2 changes: 1 addition & 1 deletion js/north.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jQuery( function( $ ) {

if ( $mobileMenu === false ) {
$mobileMenu = $( '<div></div>' )
.append( $( '.main-navigation ul' ).first().clone() )
.append( $( '.main-navigation .menu ul, .main-navigation ul.menu' ).first().clone() )
.attr( 'id', 'mobile-navigation' )
.appendTo( '#masthead' ).hide();

Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Contributors: SiteOrigin
Tags: one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-menu, custom-logo, featured-images, footer-widgets, full-width-template, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, blog, e-commerce

Requires at least: 4.7
Tested up to: 5.0.2
Tested up to: 5.1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -96,6 +96,11 @@ Original design files are available on [Google Drive](https://drive.google.com/f

== Changelog ==

= 1.7 - 24 April 2019 =
* Improved search form accessibility.
* Added a setting for the input background color located at `Customize > Theme Settings > Customize > Fonts > Form Field Background Color`.
* Prevented the mobile menu from displaying when the primary menu is empty.

= 1.6.8 - 14 March 2019 =
* Added a fallback to the default theme icon if a custom icon is missing.
* Allow main menu hovers when Touch UI Layout is enabled.
Expand Down
1 change: 1 addition & 0 deletions sass/forms/_fields.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ input[type="password"],
input[type="search"],
input[type="tel"],
textarea {
background: $color__input-background;
border: 1px solid $color__border-input;
border-radius: 0;
box-sizing: border-box;
Expand Down
1 change: 1 addition & 0 deletions sass/variables-site/_variables-site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $color__text_meta: #b0b0b0;
$color__text_menu: #898989;
$color__text_menu_hover: #595959;
$color__text_menu_current: #292929;
$color__input-background: #ffffff;

// Masthead
$masthead__background_color: #fafafa;
Expand Down
7 changes: 3 additions & 4 deletions searchform.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<form method="get" action="<?php echo esc_url( home_url( '/' ) ) ?>">
<label for='s' class='screen-reader-text'><?php esc_html_e( 'Search for:', 'siteorigin-north' ); ?></label>
<input type="search" name="s" placeholder="<?php esc_attr_e('Search', 'siteorigin-north') ?>" value="<?php echo get_search_query() ?>" />
<button type="submit">
<i class="north-icon-search"><label class="screen-reader-text"><?php esc_html_e( 'Search', 'siteorigin-north' ); ?></label></i>
<input type="search" name="s" aria-label="<?php esc_attr_e( 'Search for', 'siteorigin-north' ); ?>" placeholder="<?php esc_attr_e('Search', 'siteorigin-north') ?>" value="<?php echo get_search_query() ?>" />
<button type="submit" aria-label="<?php esc_attr_e( 'Search', 'siteorigin-north' ); ?>">
<i class="north-icon-search"></i>
</button>
</form>
1 change: 1 addition & 0 deletions style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion woocommerce/checkout/form-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// If checkout registration is disabled and not logged in, the user cannot checkout.
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'siteorgin-north' ) ) );
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'siteorigin-north' ) ) );
return;
}

Expand Down

0 comments on commit 42d0fae

Please sign in to comment.