Skip to content

Commit

Permalink
gpns-add-other-fields-to-date-schedule.php: Added other fields to t…
Browse files Browse the repository at this point in the history
…he GP Notification Scheduler.
  • Loading branch information
saifsultanc authored Jan 10, 2025
1 parent c75d9c4 commit b119d2d
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Gravity Perks // Notification Scheduler // Add other fields to the Date Schedule
* https://gravitywiz.com/documentation/gravity-forms-notification-scheduler/
*/
// Replace 131 in 'gpns_date_fields_131' with your form ID, and replace 5 in '$field->id == 5' with the field ID to add.
add_filter( 'gpns_date_fields_131', 'add_field_to_ns', 10, 2 );
function add_field_to_ns( $fields, $form ) {

// loop over the form fields
foreach ( $form['fields'] as $field ) {

// find your target field (to add to gpns)
if ( $field->id == 5 ) {
// add the target field to fields array
array_push( $fields, $field );
}
}

return $fields;
}

0 comments on commit b119d2d

Please sign in to comment.