Home / APIs / wc_get_default_product_rows_per_page() – Get the default rows setting – this is how many product rows will be shown in loops.

You appear to be a bot. Output may be restricted

Description

Get the default rows setting – this is how many product rows will be shown in loops.

Usage

$int = wc_get_default_product_rows_per_page();

Parameters

Returns

int

Source

File name: woocommerce/includes/wc-template-functions.php
Lines: 1 to 16 of 16

function wc_get_default_product_rows_per_page() {
  $rows         = absint( get_option( 'woocommerce_catalog_rows', 4 ) );
  $product_grid = wc_get_theme_support( 'product_grid' );
  $min_rows     = isset( $product_grid['min_rows'] ) ? absint( $product_grid['min_rows'] ) : 0;
  $max_rows     = isset( $product_grid['max_rows'] ) ? absint( $product_grid['max_rows'] ) : 0;

  if ( $min_rows && $rows < $min_rows ) {
    $rows = $min_rows;
    update_option( 'woocommerce_catalog_rows', $rows );
  } elseif ( $max_rows && $rows > $max_rows ) {
    $rows = $max_rows;
    update_option( 'woocommerce_catalog_rows', $rows );
  }

  return $rows;
}
 

 View on GitHub View on Trac

Published: 27th May 2018 | Last updated: 11th January 2019

Information

Function name: wc_get_default_product_rows_per_page
Plugin ref: WooCommerce
Version: 3.6.0-dev
Sourcefile: includes/wc-template-functions.php
File ref: includes/wc-template-functions.php
Deprecated?: No
API Letters: D,G,P,R,W

  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Files
  • Hooks
  • Classes
  • Sites
  • Sitemap
  • Blog
WooCommerce a2z WooCommerce a2z
WooCommerce

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2019. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins