Last active
March 29, 2018 06:31
-
-
Save Idealien/aaeb8538adcf28d16f721ca4c44f249b to your computer and use it in GitHub Desktop.
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 | |
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