Merge pull request #19412 from woocommerce/update/19408

Use wc_get_default_products_per_row as the default for product shortcodes
This commit is contained in:
Claudiu Lodromanean 2018-03-19 09:23:44 -07:00 committed by GitHub
commit e6a266e30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -113,7 +113,7 @@ class WC_Shortcode_Products {
$attributes = shortcode_atts(
array(
'limit' => '-1', // Results limit.
'columns' => '3', // Number of columns.
'columns' => '', // Number of columns.
'rows' => '', // Number of rows. If defined, limit will be ignored.
'orderby' => 'title', // menu_order, title, date, rand, price, popularity, rating, or id.
'order' => 'ASC', // ASC or DESC.
@ -134,7 +134,7 @@ class WC_Shortcode_Products {
);
if ( ! absint( $attributes['columns'] ) ) {
$attributes['columns'] = 3;
$attributes['columns'] = wc_get_default_products_per_row();
}
return $attributes;

View File

@ -14,7 +14,7 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case {
$shortcode = new WC_Shortcode_Products();
$expected = array(
'limit' => '-1',
'columns' => '3',
'columns' => '4',
'orderby' => 'title',
'order' => 'ASC',
'ids' => '',
@ -40,7 +40,7 @@ class WC_Test_Shortcode_Products extends WC_Unit_Test_Case {
) );
$expected2 = array(
'limit' => '-1',
'columns' => '3',
'columns' => '4',
'orderby' => 'id',
'order' => 'DESC',
'ids' => '',