Fix test and default
This commit is contained in:
parent
1c9143546f
commit
d099aae4ec
|
@ -113,7 +113,7 @@ class WC_Shortcode_Products {
|
|||
$attributes = shortcode_atts(
|
||||
array(
|
||||
'limit' => '-1', // Results limit.
|
||||
'columns' => wc_get_default_products_per_row(), // 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;
|
||||
|
|
|
@ -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' => '',
|
||||
|
|
Loading…
Reference in New Issue