Skip to content

Commit

Permalink
Merge branch 'release/1.7.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed Sep 7, 2020
2 parents 05fefd2 + 9bb97a9 commit 2b121ed
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 61 deletions.
2 changes: 1 addition & 1 deletion build
Submodule build updated 2 files
+590 −656 package-lock.json
+8 −8 package.json
25 changes: 0 additions & 25 deletions inc/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,6 @@ function siteorigin_north_jetpack_setup() {
endif;
add_action( 'after_setup_theme', 'siteorigin_north_jetpack_setup' );

if ( Jetpack::is_module_active( 'lazy-images' ) ) :
if ( ! function_exists( 'siteorigin_north_jetpack_logo_not_lazy' ) ) {

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

return $blacklisted_classes;
}
add_filter( 'jetpack_lazy_images_blacklisted_classes', 'siteorigin_north_jetpack_logo_not_lazy' );
}

if ( ! function_exists( 'siteorigin_north_jetpack_logo_not_lazy_class' ) ) {

function siteorigin_north_jetpack_logo_not_lazy_class( $attrs ) {
if ( ! empty( $attrs['class'] ) ) {
$attrs['class'] .= ' skip-lazy';
} else {
$attrs['class'] = 'skip-lazy';
}

return $attrs;
}
add_filter( 'siteorigin_north_logo_attributes', 'siteorigin_north_jetpack_logo_not_lazy_class' );
}
endif;

if ( ! function_exists( 'siteorigin_north_infinite_scroll_render' ) ) :
/**
Expand Down
2 changes: 1 addition & 1 deletion inc/settings
54 changes: 25 additions & 29 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,35 @@ function siteorigin_north_display_retina_logo( $attr ) {
endif;
add_filter( 'wp_get_attachment_image_attributes', 'siteorigin_north_display_retina_logo' );

if (
class_exists( 'Smush\Core\Modules\Lazy' ) ||
class_exists( 'LiteSpeed_Cache' ) ||
class_exists( 'Jetpack_Lazy_Images' )
) :
if ( ! function_exists( 'siteorigin_north_lazy_load_exclude' ) ) :
/**
* Exclude Logo from Lazy Load plugins.
*/
function siteorigin_north_lazy_load_exclude( $attr, $attachment ) {
$custom_logo_id = siteorigin_setting( 'branding_logo' );
if ( empty( $custom_logo_id ) ) {
$custom_logo_id = get_theme_mod( 'custom_logo' );
if ( ! function_exists( 'siteorigin_north_lazy_load_exclude' ) ) :
/**
* Exclude Logo from Lazy Load plugins.
*/
function siteorigin_north_lazy_load_exclude( $attr, $attachment ) {
$custom_logo_id = siteorigin_setting( 'branding_logo' );
if ( empty( $custom_logo_id ) ) {
$custom_logo_id = get_theme_mod( 'custom_logo' );
}
if ( ! empty( $custom_logo_id ) && $attachment->ID == $custom_logo_id ) {
// Jetpack Lazy Load
if ( class_exists( 'Jetpack_Lazy_Images' ) ) {
$attr['class'] .= ' skip-lazy';
}
if ( ! empty( $custom_logo_id ) && $attachment->ID == $custom_logo_id ) {
// Jetpack Lazy Load
if ( class_exists( 'Jetpack_Lazy_Images' ) ) {
$attr['class'] .= ' skip-lazy';
}
// Smush Lazy Load
if ( class_exists( 'Smush\Core\Modules\Lazy' ) ) {
$attr['class'] .= ' no-lazyload';
}
// LiteSpeed Cache Lazy Load
if ( class_exists( 'LiteSpeed_Cache' ) ) {
$attr['data-no-lazy'] = 1;
}
// Smush Lazy Load
if ( class_exists( 'Smush\Core\Modules\Lazy' ) ) {
$attr['class'] .= ' no-lazyload';
}
return $attr;
// LiteSpeed Cache Lazy Load
if ( class_exists( 'LiteSpeed_Cache' ) || class_exists( 'LiteSpeed\Media' ) ) {
$attr['data-no-lazy'] = 1;
}
// WP 5.5
$attr['loading'] = false;
}
endif;
add_filter( 'wp_get_attachment_image_attributes', 'siteorigin_north_lazy_load_exclude', 10, 2 );
return $attr;
}
endif;
add_filter( 'wp_get_attachment_image_attributes', 'siteorigin_north_lazy_load_exclude', 10, 2 );

if ( ! function_exists( 'siteorigin_north_the_post_navigation' ) ) :
/**
Expand Down
6 changes: 6 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ Original design files are available on [Google Drive](https://drive.google.com/f

== Changelog ==

= 1.7.14 - 07 September 2020 =
* Updated lazy load exclusion functionality for the logo.
* Fixed the Page Template Settings Page Title setting for WooCommerce archive pages.
* Removed `$cat_count` from the WooCommerce meta underline template.
* Updated SiteOrigin Settings.

= 1.7.13 - 01 August 2020 =
* Updated Panels Lite.
* Minor PHP formatting enhancements.
Expand Down
2 changes: 1 addition & 1 deletion searchform.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ) ?>">
<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() ?>" />
<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' ); ?>">
<?php siteorigin_north_display_icon( 'search' ); ?>
</button>
Expand Down
14 changes: 11 additions & 3 deletions woocommerce/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function siteorigin_north_woocommerce_enqueue_scripts( ){

if( is_woocommerce() ) {
wp_enqueue_script( 'siteorigin-north-woocommerce', get_template_directory_uri() . '/js/woocommerce.js', array( 'jquery' ), SITEORIGIN_THEME_VERSION );
wp_localize_script( 'siteorigin-north-woocommerce', 'so_ajax', array ( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
wp_localize_script( 'siteorigin-north-woocommerce', 'so_ajax', array ( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
}
}
endif;
Expand All @@ -123,12 +123,20 @@ function siteorigin_north_woocommerce_enqueue_scripts( ){
/**
* Define the number of columns in the loop.
*/
function siteorigin_north_woocommerce_loop_shop_columns(){
function siteorigin_north_woocommerce_loop_shop_columns() {
return 3;
}
endif;
add_filter('loop_shop_columns', 'siteorigin_north_woocommerce_loop_shop_columns');

/**
* Filter the archive page title.
*/
function siteorigin_north_woocommerce_archive_title() {
if ( siteorigin_page_setting( 'page_title' ) ) return true;
}
add_filter( 'woocommerce_show_page_title', 'siteorigin_north_woocommerce_archive_title' );

if ( ! function_exists( 'siteorigin_north_woocommerce_related_product_args' ) ) :
/**
* Define the number of columns/posts_per_page for related products.
Expand Down Expand Up @@ -258,7 +266,7 @@ function so_product_quick_view_ajax() {
* Return a standardised PayPal PNG icon.
*/
function siteorigin_north_paypal_icon() {
return get_template_directory_uri() . '/woocommerce/images/paypal-icon.png';
return get_template_directory_uri() . '/woocommerce/images/paypal-icon.png';
}
add_filter( 'woocommerce_paypal_icon', 'siteorigin_north_paypal_icon' );
endif;
Expand Down
1 change: 0 additions & 1 deletion woocommerce/single-product/meta-undertitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
}

global $post, $product;
$cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
?>
<div class="product-under-title-meta">

Expand Down

0 comments on commit 2b121ed

Please sign in to comment.