WordPress.org

Plugin Directory

Changeset 1816783


Ignore:
Timestamp:
02/06/18 20:51:34 (13 days ago)
Author:
sormano
Message:

Releasing WPPP 1.2.6

Location:
woocommerce-products-per-page
Files:
1 deleted
3 edited
16 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-products-per-page/tags/1.2.6/includes/class-wppp-front-end.php

    r1771404 r1816783  
    3636 
    3737        // Custom number of products per page 
    38         add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ), 100 ); 
    39  
    40         // Get the right amount of products from the DB 
    41         add_action( 'woocommerce_product_query', array( $this, 'woocommerce_product_query' ), 2, 50 ); 
     38        add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ), 100, 1 ); 
    4239 
    4340        // Check if ppp form is fired 
     
    9289                foreach( $products_per_page_options as $key => $value ) : 
    9390 
    94                     ?><option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->loop_shop_per_page() ); ?>><?php 
     91                    ?><option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->loop_shop_per_page( 12 ) ); ?>><?php 
    9592                        $ppp_text = apply_filters( 'wppp_ppp_text', __( '%s products per page', 'woocommerce-products-per-page' ), $value ); 
    9693                        esc_html( printf( $ppp_text, $value == -1 ? __( 'All', 'woocommerce-products-per-page' ) : $value ) ); // Set to 'All' when value is -1 
     
    155152     * @return int Products per page. 
    156153     */ 
    157     public function loop_shop_per_page() { 
     154    public function loop_shop_per_page( $per_page ) { 
    158155 
    159156        if ( isset( $_REQUEST['wppp_ppp'] ) ) : 
    160             return intval( $_REQUEST['wppp_ppp'] ); 
     157            $per_page = intval( $_REQUEST['wppp_ppp'] ); 
    161158        elseif ( isset( $_REQUEST['ppp'] ) ) : 
    162             return intval( $_REQUEST['ppp'] ); 
     159            $per_page = intval( $_REQUEST['ppp'] ); 
    163160        elseif ( isset( $_COOKIE['woocommerce_products_per_page'] ) ) : 
    164             return $_COOKIE['woocommerce_products_per_page']; 
     161            $per_page = $_COOKIE['woocommerce_products_per_page']; 
    165162        else : 
    166             return intval( get_option( 'wppp_default_ppp', '12' ) ); 
    167         endif; 
     163            $per_page = intval( get_option( 'wppp_default_ppp', '12' ) ); 
     164        endif; 
     165 
     166        return $per_page; 
    168167 
    169168    } 
  • woocommerce-products-per-page/tags/1.2.6/readme.txt

    r1775188 r1816783  
    33Tags: woocommerce, products per page, woocommerce products, woocommerce products per page, products, per page 
    44Requires at least: 4.0.0 
    5 Tested up to: 4.9 
    6 Stable tag: 1.2.5 
     5Tested up to: 4.9.4 
     6Stable tag: 1.2.6 
    77License: GPLv3 or later 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    7070== Changelog == 
    7171 
     72= 1.2.6 - 06/02/2018 = 
     73 
     74* [Critical] - Fix bug that displays 0 products on shop page on WC 3.3.1 
     75 
    7276= 1.2.5 - 20/11/2017 = 
    7377 
  • woocommerce-products-per-page/tags/1.2.6/woocommerce-products-per-page.php

    r1771404 r1816783  
    44 * Plugin URI: https://wordpress.org/plugins/woocommerce-products-per-page/ 
    55 * Description: Integrate a 'products per page' dropdown on your WooCommerce website! Set-up in <strong>seconds</strong>! 
    6  * Version: 1.2.5 
     6 * Version: 1.2.6 
    77 * Author: Jeroen Sormani 
    88 * Author URI: http://jeroensormani.com 
     9 * 
     10 * WC requires at least: 3.1.0 
     11 * WC tested up to:      3.3.0 
    912 
    1013 * Copyright Jeroen Sormani 
     
    4851     * @var string $version Plugin version number. 
    4952     */ 
    50     public $version = '1.2.5'; 
     53    public $version = '1.2.6'; 
    5154 
    5255 
     
    6871    public function __construct() { 
    6972 
    70         if ( ! function_exists( 'is_plugin_active_for_network' ) ) : 
    71             require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
    72         endif; 
    73  
    74         if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) : 
    75             if ( ! is_plugin_active_for_network( 'woocommerce/woocommerce.php' ) ) : 
    76                 return; 
    77             endif; 
    78         endif; 
     73        // Check if WooCommerce is active 
     74        require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
     75        if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) && ! function_exists( 'WC' ) ) { 
     76            return; 
     77        } 
    7978 
    8079        $this->init(); 
     
    218217        if ( $file == plugin_basename( __FILE__ ) ) : 
    219218            $links = array_merge( array( 
    220                     '<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=products&section=display#s2id_wppp_dropdown_location' ) ) . '">' . __( 'Settings', 'woocommerce-products-per-page' ) . '</a>' 
     219                '<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=products&section=display#s2id_wppp_dropdown_location' ) ) . '">' . __( 'Settings', 'woocommerce-products-per-page' ) . '</a>' 
    221220            ), $links ); 
    222221        endif; 
  • woocommerce-products-per-page/trunk/includes/class-wppp-front-end.php

    r1771404 r1816783  
    3636 
    3737        // Custom number of products per page 
    38         add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ), 100 ); 
    39  
    40         // Get the right amount of products from the DB 
    41         add_action( 'woocommerce_product_query', array( $this, 'woocommerce_product_query' ), 2, 50 ); 
     38        add_filter( 'loop_shop_per_page', array( $this, 'loop_shop_per_page' ), 100, 1 ); 
    4239 
    4340        // Check if ppp form is fired 
     
    9289                foreach( $products_per_page_options as $key => $value ) : 
    9390 
    94                     ?><option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->loop_shop_per_page() ); ?>><?php 
     91                    ?><option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->loop_shop_per_page( 12 ) ); ?>><?php 
    9592                        $ppp_text = apply_filters( 'wppp_ppp_text', __( '%s products per page', 'woocommerce-products-per-page' ), $value ); 
    9693                        esc_html( printf( $ppp_text, $value == -1 ? __( 'All', 'woocommerce-products-per-page' ) : $value ) ); // Set to 'All' when value is -1 
     
    155152     * @return int Products per page. 
    156153     */ 
    157     public function loop_shop_per_page() { 
     154    public function loop_shop_per_page( $per_page ) { 
    158155 
    159156        if ( isset( $_REQUEST['wppp_ppp'] ) ) : 
    160             return intval( $_REQUEST['wppp_ppp'] ); 
     157            $per_page = intval( $_REQUEST['wppp_ppp'] ); 
    161158        elseif ( isset( $_REQUEST['ppp'] ) ) : 
    162             return intval( $_REQUEST['ppp'] ); 
     159            $per_page = intval( $_REQUEST['ppp'] ); 
    163160        elseif ( isset( $_COOKIE['woocommerce_products_per_page'] ) ) : 
    164             return $_COOKIE['woocommerce_products_per_page']; 
     161            $per_page = $_COOKIE['woocommerce_products_per_page']; 
    165162        else : 
    166             return intval( get_option( 'wppp_default_ppp', '12' ) ); 
    167         endif; 
     163            $per_page = intval( get_option( 'wppp_default_ppp', '12' ) ); 
     164        endif; 
     165 
     166        return $per_page; 
    168167 
    169168    } 
  • woocommerce-products-per-page/trunk/readme.txt

    r1775188 r1816783  
    33Tags: woocommerce, products per page, woocommerce products, woocommerce products per page, products, per page 
    44Requires at least: 4.0.0 
    5 Tested up to: 4.9 
    6 Stable tag: 1.2.5 
     5Tested up to: 4.9.4 
     6Stable tag: 1.2.6 
    77License: GPLv3 or later 
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    7070== Changelog == 
    7171 
     72= 1.2.6 - 06/02/2018 = 
     73 
     74* [Critical] - Fix bug that displays 0 products on shop page on WC 3.3.1 
     75 
    7276= 1.2.5 - 20/11/2017 = 
    7377 
  • woocommerce-products-per-page/trunk/woocommerce-products-per-page.php

    r1771404 r1816783  
    44 * Plugin URI: https://wordpress.org/plugins/woocommerce-products-per-page/ 
    55 * Description: Integrate a 'products per page' dropdown on your WooCommerce website! Set-up in <strong>seconds</strong>! 
    6  * Version: 1.2.5 
     6 * Version: 1.2.6 
    77 * Author: Jeroen Sormani 
    88 * Author URI: http://jeroensormani.com 
     9 * 
     10 * WC requires at least: 3.1.0 
     11 * WC tested up to:      3.3.0 
    912 
    1013 * Copyright Jeroen Sormani 
     
    4851     * @var string $version Plugin version number. 
    4952     */ 
    50     public $version = '1.2.5'; 
     53    public $version = '1.2.6'; 
    5154 
    5255 
     
    6871    public function __construct() { 
    6972 
    70         if ( ! function_exists( 'is_plugin_active_for_network' ) ) : 
    71             require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
    72         endif; 
    73  
    74         if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) : 
    75             if ( ! is_plugin_active_for_network( 'woocommerce/woocommerce.php' ) ) : 
    76                 return; 
    77             endif; 
    78         endif; 
     73        // Check if WooCommerce is active 
     74        require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
     75        if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) && ! function_exists( 'WC' ) ) { 
     76            return; 
     77        } 
    7978 
    8079        $this->init(); 
     
    218217        if ( $file == plugin_basename( __FILE__ ) ) : 
    219218            $links = array_merge( array( 
    220                     '<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=products&section=display#s2id_wppp_dropdown_location' ) ) . '">' . __( 'Settings', 'woocommerce-products-per-page' ) . '</a>' 
     219                '<a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=products&section=display#s2id_wppp_dropdown_location' ) ) . '">' . __( 'Settings', 'woocommerce-products-per-page' ) . '</a>' 
    221220            ), $links ); 
    222221        endif; 
Note: See TracChangeset for help on using the changeset viewer.