Skip to content

Instantly share code, notes, and snippets.

@spivurno
Last active December 15, 2017 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/c0cf21d4d2a4863884861adf36ea9a80 to your computer and use it in GitHub Desktop.
Save spivurno/c0cf21d4d2a4863884861adf36ea9a80 to your computer and use it in GitHub Desktop.
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