Skip to content

Instantly share code, notes, and snippets.

@Idealien
Last active March 29, 2018 06:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Idealien/aaeb8538adcf28d16f721ca4c44f249b to your computer and use it in GitHub Desktop.
Save Idealien/aaeb8538adcf28d16f721ca4c44f249b to your computer and use it in GitHub Desktop.
<?php
add_filter('gravityflow_inbox_args', 'registrations_inbox_form_ids', 10, 1);
function registrations_inbox_form_ids( $args ) {
//Specify which instance of the shortcode you want to affect
if( false !== strpos($args['detail_base_url'], '/event-registrations/') ) {
$registrations = array( '106, '107');
//Or derive from a looop of all forms with a specific setting enabled
/*
$forms = GFAPI::get_forms();
$registrations = array();
foreach($forms as $form){
if( isset( $form['enable_registration'] ) && $form['enable_registration'] ) {
$registrations[] = $form['id'];
}
}
*/
$args['form_id'] = $registrations;
$args['fields'] = array();
$args['fields'][] = "2";
}
return $args;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment