Gravity Wiz // Gravity Forms // Better Inventory // Limit by ACF Custom Field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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