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( // Only add this setting if something else isn't managing the number of products per page.
'woocommerce_catalog_rows', if ( ! has_filter( 'loop_shop_per_page' ) ) {
array( $wp_customize->add_setting(
'default' => 4, 'woocommerce_catalog_rows',
'type' => 'option', array(
'capability' => 'manage_woocommerce', 'default' => 4,
'sanitize_callback' => 'absint', 'type' => 'option',
'sanitize_js_callback' => 'absint', 'capability' => 'manage_woocommerce',
) 'sanitize_callback' => 'absint',
); 'sanitize_js_callback' => 'absint',
)
);
}
$wp_customize->add_control( $wp_customize->add_control(
'woocommerce_catalog_rows', 'woocommerce_catalog_rows',