Skip to content

Commit

Permalink
Merge branch 'release/1.2.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed May 29, 2018
2 parents c64f304 + 49d4799 commit dc87b9c
Show file tree
Hide file tree
Showing 22 changed files with 243 additions and 132 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
== Changelog ==

= 1.2.7 - 29 May 2018 =
* Updated WooCommerce review meta file for WooCommerce version `3.4.0`.
* Minor style adjustments.
* Overhauled excerpt function. `polestar_excerpt_length` and `polestar_unwind_excerpt_more` deprecated.
* Styled comment form cookie consent setting.

= 1.2.6 - 11 May 2018 =
* Corrected sidebar body class conditional statements.

Expand Down
5 changes: 5 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ function polestar_enqueue_flexslider() {
require get_template_directory() . '/inc/siteorigin-panels.php';
}

/**
* Deprecated functions.
*/
require get_template_directory() . '/inc/deprecated.php';

/**
* WooCommerce compatibility.
*/
Expand Down
33 changes: 33 additions & 0 deletions inc/deprecated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* Deprecated functions.
*
* @package polestar
* @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.
* @deprecated 1.2.7 Use polestar_excerpt()
*/
function polestar_excerpt_more( $more ) {
if ( is_search() ) return;
if ( get_theme_mod( 'archive_post_content' ) == 'excerpt' && get_theme_mod( 'excerpt_more', true ) ) {
$read_more_text = get_theme_mod( 'read_more_text', esc_html__( 'Continue reading', 'polestar' ) );
return the_title( '<span class="screen-reader-text">"', '"</span>', false ) . '<p><span class="more-wrapper"><a href="' . esc_url( get_permalink() ) . '">' . $read_more_text . ' <span class="icon-long-arrow-right"></span></a></span></p>';
}
}
endif;
add_filter( 'excerpt_more', 'polestar_excerpt_more' );
2 changes: 1 addition & 1 deletion inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function polestar_body_classes( $classes ) {

// Sidebar left.
if ( get_theme_mod( 'sidebar_position' ) == 'left' && ! is_404() && $page_settings['layout'] != "constrained" && ! ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) ) {
$classes[] = 'sidebar-left';
$classes[] = 'sidebar-left';
}

// WooCommerce sidebar.
Expand Down
38 changes: 38 additions & 0 deletions inc/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,44 @@ function polestar_jetpack_setup() {
// polestar_jetpack_setup
add_action( 'after_setup_theme', 'polestar_jetpack_setup' );

/**
* Add a filter for Jetpack Featured Content.
*/
function polestar_get_featured_posts() {
return apply_filters( 'polestar_get_featured_posts', array() );
}

/**
* Check the Jetpack Featured Content.
*/
function polestar_has_featured_posts( $minimum = 1 ) {
if ( is_paged() )
return false;

$minimum = absint( $minimum );
$featured_posts = apply_filters( 'polestar_get_featured_posts', array() );

if ( ! is_array( $featured_posts ) )
return false;

if ( $minimum > count( $featured_posts ) )
return false;

return true;
}

if ( ! function_exists( 'polestar_display_featured_posts' ) ) :
/**
* Output the Jetpack Featured Content.
*/
function polestar_display_featured_posts() {
if ( is_home() && polestar_has_featured_posts() ) {
get_template_part( 'template-parts/featured', 'slider' );
}
}
endif;
add_action( 'polestar_content_before', 'polestar_display_featured_posts' );

if ( ! function_exists( 'polestar_infinite_scroll_render' ) ) :
/**
* Custom render function for Infinite Scroll.
Expand Down
96 changes: 36 additions & 60 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,44 +146,6 @@ function polestar_footer_text() {
}
endif;

/**
* Add a filter for Jetpack Featured Content.
*/
function polestar_get_featured_posts() {
return apply_filters( 'polestar_get_featured_posts', array() );
}

/**
* Check the Jetpack Featured Content.
*/
function polestar_has_featured_posts( $minimum = 1 ) {
if ( is_paged() )
return false;

$minimum = absint( $minimum );
$featured_posts = apply_filters( 'polestar_get_featured_posts', array() );

if ( ! is_array( $featured_posts ) )
return false;

if ( $minimum > count( $featured_posts ) )
return false;

return true;
}

if ( ! function_exists( 'polestar_display_featured_posts' ) ) :
/**
* Output the Jetpack Featured Content.
*/
function polestar_display_featured_posts() {
if ( is_home() && polestar_has_featured_posts() ) {
get_template_part( 'template-parts/featured', 'slider' );
}
}
endif;
add_action( 'polestar_content_before', 'polestar_display_featured_posts' );

if ( ! function_exists( 'polestar_display_icon' ) ) :
/**
* Display theme icons.
Expand Down Expand Up @@ -397,40 +359,54 @@ function polestar_display_logo() {
}
endif;

if ( ! function_exists( 'polestar_excerpt_length' ) ) :
if ( ! function_exists( 'polestar_read_more_link' ) ) :
/**
* Filter the excerpt length.
* Filter the read more link.
*/
function polestar_excerpt_length( $length ) {
return get_theme_mod( 'excerpt_length', 55 );
function polestar_read_more_link() {
$read_more_text = get_theme_mod( 'read_more_text', esc_html__( 'Continue reading', 'polestar' ) );
return 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>';
}
add_filter( 'excerpt_length', 'polestar_excerpt_length', 10 );
endif;
add_filter( 'the_content_more_link', 'polestar_read_more_link' );

if ( ! function_exists( 'polestar_excerpt_more' ) ) :
if ( ! function_exists( 'polestar_excerpt' ) ) :
/**
* Add a more link to the excerpt.
* Outputs the excerpt.
*/
function polestar_excerpt_more( $more ) {
if ( is_search() ) return;
if ( get_theme_mod( 'archive_post_content' ) == 'excerpt' && get_theme_mod( 'excerpt_more', true ) ) {
function polestar_excerpt() {

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' ) );
return the_title( '<span class="screen-reader-text">"', '"</span>', false ) . '<p><span class="more-wrapper"><a href="' . esc_url( get_permalink() ) . '">' . $read_more_text . ' <span class="icon-long-arrow-right"></span></a></span></p>';
$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 = '';
}
}
endif;
add_filter( 'excerpt_more', 'polestar_excerpt_more' );
$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 );

echo $excerpt;

if ( ! function_exists( 'polestar_read_more_link' ) ) :
/**
* Filter the read more link.
*/
function polestar_read_more_link() {
$read_more_text = get_theme_mod( 'read_more_text', esc_html__( 'Continue reading', 'polestar' ) );
return 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>';
}
endif;
add_filter( 'the_content_more_link', 'polestar_read_more_link' );

if ( ! function_exists( 'polestar_post_meta' ) ) :
/**
Expand Down
2 changes: 1 addition & 1 deletion loops/loop-slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="slide-content">
<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
<div class="entry-excerpt">
<?php the_excerpt(); ?>
<?php polestar_excerpt(); ?>
</div>
</div>
</li>
Expand Down
6 changes: 5 additions & 1 deletion sass/media/_posts-slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@

@media (max-width: 480px) {
display: none;
}
}

.more-wrapper {
display: none;
}
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions sass/site/primary/_comments.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,23 @@
}
}

.comment-form-cookies-consent {
align-items: center;
clear: both;
display: flex;

input {
line-height: 1;
margin-right: 5px;
}

label {
display: inline-block;
font-weight: normal;
margin-bottom: 0;
}
}

.form-submit {
margin: 0;
clear: both;
Expand Down
8 changes: 0 additions & 8 deletions sass/site/primary/_posts-and-pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
font-size: 29px;
line-height: normal;
margin: 0;

@media (max-width: 768px) {
font-size: 26px;
}

@media (max-width: 480px) {
font-size: 23px;
}

a {
color: $color__text-dark;
Expand Down
4 changes: 4 additions & 0 deletions sass/typography/_headings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ h6 {
@include font-smoothing(subpixel-antialiased);
font-weight: 600;
margin: 25px 0;

@media (max-width: 480px) {
line-height: normal;
}
}

h1 {
Expand Down
6 changes: 1 addition & 5 deletions sass/woocommerce/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

.clear {
clear: both;
}

.content-area {
width: 100%;
}

.col2-set {
width: 100%;

Expand Down
7 changes: 5 additions & 2 deletions sass/woocommerce/_single.scss
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,12 @@
.meta {
color: $color__text-dark;
font-size: 14px;
font-weight: bold;
font-weight: 600;
line-height: normal;
line-height: normal;

strong {
font-weight: 600;
}

a {
color: $color__text-dark;
Expand Down
28 changes: 22 additions & 6 deletions style.css

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

Loading

0 comments on commit dc87b9c

Please sign in to comment.