WordPress filter hook
woocommerce_get_asset_url
Defined by WooCommerce and fired by 10 plugins in total, running on 7M+ sites between them.
“Filters the asset URL.”
How to use woocommerce_get_asset_url
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_get_asset_url', function( $plugins_url, $path ) {
// Change $plugins_url here.
return $plugins_url;
}, 10, 2 );Argument names come from VARGAL's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
10 plugins that fire woocommerce_get_asset_url
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_get_asset_url', plugins_url( $path, Constants::get_constant( 'WC_PLUGIN_FILE' ) ), $path )src/Internal/AddressProvider/AbstractAutomatticAddressProvider.php:265 -
Product Table & List Builder for WooCommerce10,000+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url('assets/js/frontend/add-to-cart' . $min . '.js', WC_PLUGIN_FILE), 'assets/js/frontend/add-to-cart' . $min . '.js' )main.php:2130 -
VARGAL1,000+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url( $path, WC_PLUGIN_FILE ), $path )compatible/bricks.php:44 -
UiCore Blocks500+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url($path, WC_PLUGIN_FILE), $path )assets/blocks/dynamic/post-grid/render.php:134 -
Meest for WooCommerce100+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url( $path, $wcPluginFile ), $path )src/Modules/Asset.php:184 -
PeproDev Ultimate Profile Solutions70+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url($path, WC_PLUGIN_FILE), $path )profile/profile.php:1437 -
Checkout Custom Fields Builder for WooCommerce30+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url( 'assets/js/frontend/checkout' . $suffix . '.js', WC_PLUGIN_FILE ), 'assets/js/frontend/checkout' . $suffix . '.js' )includes/Frontend/Elementor.php:135 -
TABLEiT20+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url('assets/js/frontend/add-to-cart.js', WC_PLUGIN_FILE), 'assets/js/frontend/add-to-cart.js' )front-scripts.php:130 -
WC China Checkout 物流通知插件10+ installs
apply_filters( 'woocommerce_get_asset_url', plugins_url( $path, WC_PLUGIN_FILE ), $path )includes/shop/class-wc-sinic-hooks.php:437 -
IPS Cart&Checkout for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_get_asset_url', $url, $path )includes/classes/Front/Checkout/Portal/Assets/CheckoutPortalWooCompatibilityAssets.php:73
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.