Merge array with wp_parse_args.

This commit is contained in:
Tiago Noronha 2017-08-06 23:55:29 +01:00
parent 3e5f77d27c
commit b0a272a755
1 changed files with 1 additions and 5 deletions

View File

@ -92,11 +92,7 @@ add_filter( 'loop_shop_columns', '_s_woocommerce_loop_columns' );
* @return array $args related products args
*/
function _s_woocommerce_related_products_args( $args ) {
$args = apply_filters( '_s_woocommerce_related_products_args', array(
'posts_per_page' => 3,
'columns' => 3,
) );
$args = wp_parse_args( array( 'posts_per_page' => 3, 'columns' => 3 ), $args );
return $args;
}
add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_products_args' );