Skip to content

Instantly share code, notes, and snippets.

@billrobbins
Last active May 9, 2020 19:07
Show Gist options
  • Save billrobbins/fae4ed03be0d04e2dbc05eded60f3929 to your computer and use it in GitHub Desktop.
Save billrobbins/fae4ed03be0d04e2dbc05eded60f3929 to your computer and use it in GitHub Desktop.
add_action( 'customize_register', 'jp_override_storefront_powerpack', 21 );
/**
* @param WP_Customize_Manager $wp_customizer
*/
function jp_override_storefront_powerpack( $wp_customizer ) {
$controls = array(
'sp_homepage_featured_products_limit',
'sp_homepage_top_rated_products_limit',
'sp_homepage_on_sale_products_limit',
'sp_homepage_recent_products_limit',
'sp_homepage_category_limit',
'sp_homepage_best_sellers_products_limit',
);
foreach ( $controls as $control ) {
$control_object = $wp_customizer->get_control( $control );
if ( ! $control_object ) {
continue;
}
for ( $i = 13; $i < 25; $i++ ) {
$string = (string) $i;
$control_object->choices[ $string ] = $string;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment