wc_reset_product_grid_settings()

Reset the product grid settings when a new theme is activated.


Description Description


Source Source

File: includes/wc-template-functions.php

435
436
437
438
439
440
441
442
443
444
445
446
447
function wc_reset_product_grid_settings() {
    $product_grid = wc_get_theme_support( 'product_grid' );
 
    if ( ! empty( $product_grid['default_rows'] ) ) {
        update_option( 'woocommerce_catalog_rows', absint( $product_grid['default_rows'] ) );
    }
 
    if ( ! empty( $product_grid['default_columns'] ) ) {
        update_option( 'woocommerce_catalog_columns', absint( $product_grid['default_columns'] ) );
    }
 
    wp_cache_flush(); // Flush any caches which could impact settings or templates.
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.