Last active
December 15, 2017 22:03
-
-
Save spivurno/c0cf21d4d2a4863884861adf36ea9a80 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Better Inventory // Limit by ACF Custom Field
This file contains hidden or 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