Dont show row settings if something is managing the number of products per page

This commit is contained in:
claudiulodro 2018-01-31 15:50:48 -08:00
parent 2d8d5f3fdb
commit 14fa87ab1f
1 changed files with 13 additions and 10 deletions

View File

@ -404,16 +404,19 @@ class WC_Shop_Customizer {
)
);
$wp_customize->add_setting(
'woocommerce_catalog_rows',
array(
'default' => 4,
'type' => 'option',
'capability' => 'manage_woocommerce',
'sanitize_callback' => 'absint',
'sanitize_js_callback' => 'absint',
)
);
// Only add this setting if something else isn't managing the number of products per page.
if ( ! has_filter( 'loop_shop_per_page' ) ) {
$wp_customize->add_setting(
'woocommerce_catalog_rows',
array(
'default' => 4,
'type' => 'option',
'capability' => 'manage_woocommerce',
'sanitize_callback' => 'absint',
'sanitize_js_callback' => 'absint',
)
);
}
$wp_customize->add_control(
'woocommerce_catalog_rows',