Skip to content

Commit

Permalink
Merge branch 'release/1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed May 27, 2021
2 parents 67794ea + f54952c commit 5012f0c
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 51 deletions.
4 changes: 1 addition & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ function polestar_scripts() {
wp_enqueue_style( 'polestar-style', get_template_directory_uri() . '/style' . PURO_THEME_CSS_PREFIX . '.css', array(), PURO_THEME_VERSION );

// FitVids.
if ( ! ( function_exists( 'has_blocks' ) && has_blocks() ) ) {
wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids' . PURO_THEME_JS_PREFIX . '.js', array( 'jquery' ), '1.1', true );
}
wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids' . PURO_THEME_JS_PREFIX . '.js', array( 'jquery' ), '1.1', true );

// Flexslider.
wp_register_script( 'jquery-flexslider', get_template_directory_uri() . '/js/jquery.flexslider' . PURO_THEME_JS_PREFIX . '.js', array( 'jquery' ), '2.6.3', true );
Expand Down
2 changes: 1 addition & 1 deletion inc/customizer-library
12 changes: 0 additions & 12 deletions inc/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
* @license GPL 2.0
*/

if ( ! function_exists( 'polestar_excerpt_length' ) ) :
/**
* Filter the excerpt length.
* @deprecated 1.2.7 Use polestar_excerpt()
*/
function polestar_excerpt_length( $length ) {
return get_theme_mod( 'excerpt_length', 55 );
}
add_filter( 'excerpt_length', 'polestar_excerpt_length', 10 );
endif;

if ( ! function_exists( 'polestar_excerpt_more' ) ) :
/**
* Add a more link to the excerpt.
Expand All @@ -30,4 +19,3 @@ function polestar_excerpt_more( $more ) {
}
}
endif;
add_filter( 'excerpt_more', 'polestar_excerpt_more' );
64 changes: 36 additions & 28 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ function polestar_breadcrumbs() {
* Display the WooCommerce mini cart.
*/
function polestar_mini_cart() {
if ( class_exists( 'Woocommerce' ) && ! ( is_cart() || is_checkout() ) ) : ?>
<?php global $woocommerce; ?>
if (
class_exists( 'Woocommerce' ) &&
apply_filters( 'polestar_display_mini_cart', ! ( is_cart() || is_checkout() ) )
) :
global $woocommerce;
?>
<ul class="shopping-cart">
<li>
<a class="shopping-cart-link" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View shopping cart', 'polestar' ); ?>">
Expand Down Expand Up @@ -431,19 +435,19 @@ function polestar_logo_lazy_load_exclude( $attr, $attachment ) {

if ( ! empty( $custom_logo_id ) && $attachment->ID == $custom_logo_id ) {
// Jetpack Lazy Load
if ( class_exists( 'Jetpack_Lazy_Images' ) ) {
if ( class_exists( 'Jetpack_Lazy_Images' ) || class_exists( 'Automattic\\Jetpack\\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' ) ) {
if ( class_exists( 'LiteSpeed_Cache' ) || class_exists( 'LiteSpeed\Media' ) ) {
$attr['data-no-lazy'] = 1;
}
// WP 5.5
$attr['loading'] = 'eager';
}
return $attr;
}
Expand All @@ -459,19 +463,19 @@ function polestar_featured_image_lazy_load_exclude( $attr, $attachment ) {

if ( ! empty( $featured_image_id ) && $attachment->ID == $featured_image_id ) {
// Jetpack Lazy Load
if ( class_exists( 'Jetpack_Lazy_Images' ) ) {
if ( class_exists( 'Jetpack_Lazy_Images' ) || class_exists( 'Automattic\\Jetpack\\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' ) ) {
if ( class_exists( 'LiteSpeed_Cache' ) || class_exists( 'LiteSpeed\Media' ) ) {
$attr['data-no-lazy'] = 1;
}
// WP 5.5
$attr['loading'] = 'eager';
}
return $attr;
}
Expand All @@ -490,37 +494,41 @@ function polestar_read_more_link() {
endif;
add_filter( 'the_content_more_link', 'polestar_read_more_link' );

if ( ! function_exists( 'polestar_excerpt_length' ) ) :
/**
* Filter the excerpt length.
*/
function polestar_excerpt_length( $length ) {
return ! empty( get_theme_mod( 'excerpt_length' ) ) ? get_theme_mod( 'excerpt_length' ) : 55;
}
add_filter( 'excerpt_length', 'polestar_excerpt_length', 10 );
endif;

if ( ! function_exists( 'polestar_excerpt' ) ) :
/**
* Outputs the excerpt.
*/
function polestar_excerpt() {

if ( ( get_theme_mod( 'archive_post_content' ) == 'excerpt' && get_theme_mod( 'excerpt_more', true ) ) && ! is_search() ) {
if ( ( get_theme_mod( 'archive_post_content' ) == 'excerpt' ) && get_theme_mod( 'excerpt_more', true ) && ! is_search() ) {
$read_more_text = get_theme_mod( 'read_more_text', esc_html__( 'Continue reading', 'polestar' ) );
$read_more_text = the_title( '<span class="screen-reader-text">"', '"</span>', false ) . '<span class="more-wrapper"><a href="' . esc_url( get_permalink() ) . '">' . $read_more_text . ' <span class="icon-long-arrow-right"></span></a></span>';
} else {
$read_more_text = '';
}
$ellipsis = '...';
$length = get_theme_mod( 'excerpt_length', 55 );
$excerpt = explode( ' ', get_the_excerpt(), $length );

if ( $length ) {
if ( count( $excerpt ) >= $length ) {
array_pop( $excerpt );
$excerpt = '<p>' . implode( " ", $excerpt ) . $ellipsis . '</p>' . $read_more_text;
} else {
$excerpt = '<p>' . implode( " ", $excerpt ) . $ellipsis . '</p>';
}
} else {
$excerpt = get_the_excerpt();
}

$excerpt = preg_replace( '`\[[^\]]*\]`','', $excerpt );
$length = ! empty( get_theme_mod( 'excerpt_length' ) ) ? get_theme_mod( 'excerpt_length' ) : 55;
$excerpt = get_the_excerpt();
$excerpt_add_read_more = str_word_count( $excerpt ) >= $length;

if ( ! has_excerpt() ) {
$excerpt = '<p>' . wp_trim_words( $excerpt, $length, '...' ) . '</p>';
}

echo $excerpt;
if ( ! empty( $read_more_text ) && ( has_excerpt() || $excerpt_add_read_more ) ) {
$excerpt = '<p>' . $excerpt . '</p>' . '<p>' . $read_more_text . '</p>';
}

echo wp_kses_post( $excerpt );
}
endif;

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
} );

// Main menu.
$( window ).load( function() {
$( window ).on( 'load', function() {
$( 'body.no-js' ).removeClass( 'no-js' );
if ( $( 'body' ).hasClass( 'css3-animations' ) ) {

Expand Down
14 changes: 12 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: Puro

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, sticky-post, theme-options, threaded-comments, translation-ready, blog, e-commerce

Tested up to: 5.6
Tested up to: 5.7
Requires at least: 4.7
Requires PHP: 5.6.20
License: GPLv2 or later
Expand Down Expand Up @@ -152,7 +152,17 @@ Released under [GPL version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0

== Changelog ==

= 1.5.0 - 04 February 2020 =
= 1.6.0 - 27 May 2021 =
* Updated logo lazy loading exclusion function.
* Updated featured image lazy load function.
* Minor adjustment to search results spacing.
* Improved the custom excerpt function.
* Added FitVids to the Block Editor.
* Updated Customizer Library.
* Developer: Added WooCommerce `polestar_display_mini_cart` filter to allow the mini-cart to be hidden when empty.
* Developer: Updated a theme JS function for jQuery 3.5 that was previously overlooked.

= 1.5.0 - 04 February 2021 =
* Added RankMath breadcrumb support.
* WooCommerce: Linked mini-cart View Cart hover color setting to `Accent Color`.
* WooCommerce: Improved Quick View gallery variation support.
Expand Down
2 changes: 1 addition & 1 deletion sass/site/primary/_posts-and-pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
article {
border-bottom: 1px solid $color__background-hr;
margin: 0 0 50px;
padding: 0 0 30px;
padding: 0 0 50px;

&:last-of-type {
border: 0;
Expand Down
2 changes: 1 addition & 1 deletion sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Author URI: https://purothemes.com/
Theme URI: https://purothemes.com/themes/polestar/
Description: Lead the way with Polestar. It's fast loading, responsive, lightweight and flexible design is perfectly suited for building dynamic pages with SiteOrigin's Page Builder and selling with WooCommerce. Ecommerce features include a menu mini-cart and product quick-view. Polestar features a sticky header, beautiful header search, scroll to top and just the right amount of Customizer theme settings. Page level settings let you adjust the theme layout on a page by page basis, perfect for landing pages. If you run a blog, Polestar is ready with awesome features including a full-width posts slider integrated with Jetpack Featured Content, an author box and related posts section. For assistance, check out our <a href="http://purothemes.com/documentation/">theme documentation</a> (http://purothemes.com/documentation/) or ask a question on our <a href="https://purothemes.com/support/">support forum</a> (https://purothemes.com/support/).
Version: dev
Tested up to: 5.6
Tested up to: 5.7
Requires at least: 4.7
Requires PHP: 5.6.20
License: GNU General Public License v2 or later
Expand Down
4 changes: 2 additions & 2 deletions style.css

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

0 comments on commit 5012f0c

Please sign in to comment.