Skip to content

Commit

Permalink
1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
webmandesign committed Feb 2, 2018
1 parent e4d1d7e commit 5055acb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Reykjavik Changelog

## 1.0.6

* **Fix**: WooCommerce 3.3- backwards compatibility

### Files changed:

changelog.md
style.css
includes/plugins/woocommerce/class-woocommerce-loop.php


## 1.0.5

* **Add**: Compatibility with WooCommerce 3.3 product grid options
Expand Down
21 changes: 14 additions & 7 deletions includes/plugins/woocommerce/class-woocommerce-loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 1.0.0
* @version 1.0.5
* @version 1.0.6
*
* Contents:
*
Expand Down Expand Up @@ -330,16 +330,13 @@ public static function active_filters() {
* Pagination
*
* @since 1.0.0
* @version 1.0.5
* @version 1.0.6
*/
public static function pagination() {

// Requirements check

if (
! function_exists( 'woocommerce_pagination' )
|| ! function_exists( 'wc_get_loop_prop' )
) {
if ( ! function_exists( 'woocommerce_pagination' ) ) {
return;
}

Expand All @@ -349,9 +346,19 @@ public static function pagination() {
ob_start();
woocommerce_pagination();

if ( function_exists( 'wc_get_loop_prop' ) ) {
$total = wc_get_loop_prop( 'total_pages' );
$current = wc_get_loop_prop( 'current_page' );
} else {
// WooCommerce 3.3- backwards compatibility
global $wp_query;
$total = ( isset( $wp_query->max_num_pages ) ) ? ( $wp_query->max_num_pages ) : ( 1 );
$current = ( get_query_var( 'paged' ) ) ? ( absint( get_query_var( 'paged' ) ) ) : ( 1 );
}

$html = str_replace(
'<nav class="woocommerce-pagination',
'<nav aria-label="' . esc_attr__( 'Products Navigation', 'reykjavik' ) . '" data-current="' . esc_attr( wc_get_loop_prop( 'current_page' ) ) . '" data-total="' . esc_attr( wc_get_loop_prop( 'total_pages' ) ) . '" class="pagination woocommerce-pagination',
'<nav aria-label="' . esc_attr__( 'Products Navigation', 'reykjavik' ) . '" data-current="' . esc_attr( $current ) . '" data-total="' . esc_attr( $total ) . '" class="pagination woocommerce-pagination',
ob_get_clean()
);

Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: Reykjavik
Theme URI: https://www.webmandesign.eu/portfolio/reykjavik-wordpress-theme/
Author: WebMan Design
Author URI: https://www.webmandesign.eu/
Version: 1.0.5
Version: 1.0.6
Text Domain: reykjavik
Domain Path: /languages
License: GNU General Public License v3
Expand Down

0 comments on commit 5055acb

Please sign in to comment.