We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
gpml-auto-add-terms.php
experimental
1 parent 56e6249 commit 2c4f134Copy full SHA for 2c4f134
gp-media-library/gpml-auto-add-terms.php
@@ -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