Skip to content

Commit

Permalink
Merge branch 'release/1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed Oct 2, 2018
2 parents 7079977 + fa73fce commit b90e73e
Show file tree
Hide file tree
Showing 14 changed files with 372 additions and 345 deletions.
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
== Changelog ==

= 1.8 - 03 October 2018 =
* Removed WooCommerce archive overlay unless Quick View or Add to Cart is enabled.
* Changed YARPP to use `get_the_date()` instead of `the_date()` for post meta.
* Added a blog post author setting at Customize > Theme Settings > Blog. The setting is disabled by default.
* Resolved a problem with logo scaling when returning to the top of the page.
* Resolved a problem with Corp logo scaling and Jetpack Lazy Images.
* Prevented FitVids.js from loading if user is viewing a Gutenberg page.
* Removed `h1` to `h6` clearing.

= 1.7.1 - 17 September 2018 =
* Use `get_the_date()` instead of `the_date()` for related post meta.
* Changed WooCommerce archive product overlay clickable.
Expand Down
4 changes: 2 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function siteorigin_corp_scripts() {
// FitVids.
wp_register_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), '1.1', true );

if ( ! class_exists( 'Jetpack' ) ) {
if ( ! class_exists( 'Jetpack' ) && ! ( function_exists( 'has_blocks' ) && has_blocks() ) ) {
wp_enqueue_script( 'jquery-fitvids' );
}

Expand All @@ -181,7 +181,7 @@ function siteorigin_corp_scripts() {
// Theme JavaScript.
wp_enqueue_script( 'siteorigin-corp-script', get_template_directory_uri() . '/js/jquery.theme' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), SITEORIGIN_THEME_VERSION, true );

// Mobile menu collapse and Sticky Logo Scaling localisation.
// Mobile Menu Collapse and Sticky Logo Scaling localisation.
$logo_sticky_scale = apply_filters( 'siteorigin_corp_logo_sticky_scale', 0.755 );
wp_localize_script( 'siteorigin-corp-script', 'siteoriginCorp', array(
'collapse' => siteorigin_setting( 'navigation_mobile_menu_collapse' ),
Expand Down
33 changes: 19 additions & 14 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ function siteorigin_corp_body_classes( $classes ) {
if ( siteorigin_setting( 'woocommerce_shop_sidebar' ) == 'left' ) {
$classes[] = 'woocommerce-sidebar-left';
}
}
}

// WooCommerce archive Quick View and Add to Cart.
if ( function_exists( 'is_woocommerce' ) && ( is_shop() || is_product_category() || is_product_tag() ) && ( siteorigin_setting( 'woocommerce_quick_view' ) || siteorigin_setting( 'woocommerce_add_to_cart' ) ) ) {
$classes[] = 'woocommerce-product-overlay';
}

return $classes;
}
Expand All @@ -90,19 +95,19 @@ function siteorigin_corp_pingback_header() {
* Unset the current menu class.
*/
function siteorigin_corp_unset_current_menu_class( $classes ) {
$disallowed_class_names = array(
'current-menu-item',
'current_page_item',
);
foreach ( $classes as $class ) {
if ( in_array( $class, $disallowed_class_names ) ) {
$key = array_search( $class, $classes );
if ( false !== $key ) {
unset( $classes[$key] );
}
}
}
return $classes;
$disallowed_class_names = array(
'current-menu-item',
'current_page_item',
);
foreach ( $classes as $class ) {
if ( in_array( $class, $disallowed_class_names ) ) {
$key = array_search( $class, $classes );
if ( false !== $key ) {
unset( $classes[$key] );
}
}
}
return $classes;
}
endif;
add_filter( 'nav_menu_css_class', 'siteorigin_corp_unset_current_menu_class', 10, 1 );
Expand Down
23 changes: 18 additions & 5 deletions inc/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ function siteorigin_corp_infinite_scroll_render() {
* Remove sharing buttons from their default locations
*/
function siteorigin_corp_remove_share() {
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
if ( class_exists( 'Jetpack_Likes' ) ) {
remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
}
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
if ( class_exists( 'Jetpack_Likes' ) ) {
remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
}
}
add_action( 'loop_start', 'siteorigin_corp_remove_share' );

Expand Down Expand Up @@ -145,3 +145,16 @@ function siteorigin_corp_jetpackme_remove_rp() {
}
endif;
add_filter( 'wp', 'siteorigin_corp_jetpackme_remove_rp', 20 );

// If Jetpack Lazy Images is enabled, prevent the logo from being affected.
if ( Jetpack::is_module_active( 'lazy-images' ) ) :
if ( ! function_exists( 'siteorigin_corp_jetpack_logo_not_lazy' ) ) {

function siteorigin_corp_jetpack_logo_not_lazy( $blacklisted_classes ) {
$blacklisted_classes[] = 'custom-logo';

return $blacklisted_classes;
}
add_filter( 'jetpack_lazy_images_blacklisted_classes', 'siteorigin_corp_jetpack_logo_not_lazy' );
}
endif;
Loading

0 comments on commit b90e73e

Please sign in to comment.