MainWP Community

Show trailing zeros from WooCommerce just in wp-admin

Show trailing zeros from WooCommerce just in wp-admin on your child site.

Snippet Type

Execute on Child Sites

Snippet

function filter_woocommerce_price_trim_zeros( $trim ) {
    // True if inside WordPress administration interface, false otherwise.
    // if NOT true = false
    if ( ! is_admin() ) {
        $trim = true;
    }

    return $trim;
}
add_filter( 'woocommerce_price_trim_zeros', 'filter_woocommerce_price_trim_zeros', 10, 1 );
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.