Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gravity Wiz // Gravity Forms // Better Inventory // Limit by ACF Custom Field
<?php
/**
* Gravity Wiz // Gravity Forms // Better Inventory // Limit by ACF Custom Field
* https://gravitywiz.com/better-inventory-with-gravity-forms/
*/
add_filter( 'wp', function() {
if( function_exists( 'get_field' ) ) {
$gwinv = new GW_Inventory( array(
'form_id' => 123,
'field_id' => 1.3,
'stock_qty' => get_field( 'YOUR_CUSTOM_FIELD' ),
) );
$gwinv->init();
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.