Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter( 'gppa_input_choices_18_10', function( $choices, $field, $objects ) {
array_unshift( $choices, array(
'text' => 'Testtext',
'value' => 'Testvalue' ,
'isSelected' => false,
'inventory_limit' => 100,
@agssl
agssl / gravity_inventory.php
Created October 17, 2024 07:30
Inventory Demo
<?php
class SetInventory {
public $form_id;
public $inventory_field_id;
public $date_field_id;
public $days;
function __construct($args){
@agssl
agssl / gpi_inventory_defaults_exceptions.php
Created May 3, 2023 08:08
GP Inventory / Defaults and excepetions
<?php
$form_id = 4;
$inventory_field_id = 3;
$date_field_id = 1;
add_filter( 'gppa_input_choices_' . $form_id . '_' . $inventory_field_id, function( $choices, $field, $objects ) {
$days = get_field('additional_dates', 'options');

h1 Heading 8-)

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

Lists

<?php
if(is_admin()) {
return;
}
$formID = 2;
if($formID):