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 * @return array $args related products args
*/ */
function _s_woocommerce_related_products_args( $args ) { function _s_woocommerce_related_products_args( $args ) {
$args = apply_filters( '_s_woocommerce_related_products_args', array( $args = wp_parse_args( array( 'posts_per_page' => 3, 'columns' => 3 ), $args );
'posts_per_page' => 3,
'columns' => 3,
) );
return $args; return $args;
} }
add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_products_args' ); add_filter( 'woocommerce_output_related_products_args', '_s_woocommerce_related_products_args' );