Skip to content

Commit 2c4f134

Browse files
authored
gpml-auto-add-terms.php: Migrated from experimental folder.
1 parent 56e6249 commit 2c4f134

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Media Library // Add terms to new Media Library files.
4+
* https://gravitywiz.com/documentation/gravity-forms-media-library/
5+
*
6+
* Experimental Snippet 🧪
7+
*/
8+
// Update "123" to your form ID and "4" to your GPML-enabled File Upload field.
9+
add_action( 'gpml_media_data_123_4', function( $gpml_media_data ) {
10+
$terms = array(
11+
'category' => array(
12+
'Red',
13+
'Green',
14+
'Blue',
15+
),
16+
'post_tag' => array(
17+
'Small',
18+
'Medium',
19+
'Large',
20+
),
21+
);
22+
$gpml_media_data['post_data']['tax_input'] = $terms;
23+
return $gpml_media_data;
24+
}, 10, 2 );

0 commit comments

Comments
 (0)