Skip to content

Instantly share code, notes, and snippets.

@chuckmo
chuckmo / load_partials.php
Last active March 10, 2017 13:19
Loading ACF Flexible Content partials
<?php
function self_get_page_sections($path = ''){
// check if the flexible content field has rows of data
if( have_rows('content_blocks') ):
// loop through the rows of data
while ( have_rows('content_blocks') ) : the_row();
@chuckmo
chuckmo / diable_wc_shipping_rates_cache.php
Last active September 7, 2023 22:17
Disable WooCommerce's Shipping Rates Cache
// updated per harisrozak:
add_filter('woocommerce_checkout_update_order_review', 'clear_wc_shipping_rates_cache');
function clear_wc_shipping_rates_cache(){
$packages = WC()->cart->get_shipping_packages();
foreach ($packages as $key => $value) {
$shipping_session = "shipping_for_package_$key";