Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions gp-populate-anything/gppa-add-a-custom-choice-template.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
/**
* Gravity Perks // Populate Anything // Add A Custom Choice Template
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* Choice templates allow you to map data to different properties of your Gravity Forms choices. In this example, we
* demonstrate how to create a new template for a theoretical "image" choice property. With this in place, you would
* be able to select a value in the Populate Anything choices UI that is mapped to the "image" property for each choice.
*/
add_filter( 'gppa_input_choice', function( $choice, $field, $object, $objects ) {
$choice['image'] = gp_populate_anything()->process_template( $field, 'image', $object, 'choices', $objects );
return $choice;
}, 10, 4 );