Changeset 2662026
- Timestamp:
- 01/23/2022 06:03:33 AM (4 years ago)
- Location:
- post-update-addon-gravity-forms
- Files:
-
- 4 edited
- 5 copied
-
tags/1.1.3 (copied) (copied from post-update-addon-gravity-forms/trunk)
-
tags/1.1.3/class-post-update-addon.php (copied) (copied from post-update-addon-gravity-forms/trunk/class-post-update-addon.php) (2 diffs)
-
tags/1.1.3/feed-settings.php (copied) (copied from post-update-addon-gravity-forms/trunk/feed-settings.php) (1 diff)
-
tags/1.1.3/post-update-addon-gravity-forms.php (copied) (copied from post-update-addon-gravity-forms/trunk/post-update-addon-gravity-forms.php) (1 diff)
-
tags/1.1.3/readme.txt (copied) (copied from post-update-addon-gravity-forms/trunk/readme.txt) (4 diffs)
-
trunk/class-post-update-addon.php (modified) (2 diffs)
-
trunk/feed-settings.php (modified) (1 diff)
-
trunk/post-update-addon-gravity-forms.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-update-addon-gravity-forms/tags/1.1.3/class-post-update-addon.php
r2636641 r2662026 78 78 $this->process_taxonomy($feed, $entry, 'category', $post_id); 79 79 $this->process_taxonomy($feed, $entry, 'post_tag', $post_id); 80 $this->process_custom_taxonomies($feed, $entry, $post_id); 80 81 81 82 // Updating meta fields … … 172 173 } 173 174 175 function process_custom_taxonomies($feed, $entry, $post_id) { 176 $tax_map = $this->get_dynamic_field_map_fields($feed, 'custom_tax_settings'); 177 $tax_mode = rgars($feed, 'meta/custom_tax_override_mode'); 178 179 foreach($tax_map as $tax_slug => $tax_field_id) { 180 $new_tax_value = trim(rgar($entry, $tax_field_id)); 181 if($new_tax_value === '' && $tax_mode === 'override_not_empty') continue; 182 wp_set_object_terms($post_id, explode(',', $new_tax_value), $tax_slug, $tax_mode === 'append'); 183 } 184 } 185 174 186 function prepare_author_id($feed, $entry, $form, &$postarr) { 175 187 $author_id = rgars($feed, 'meta/author_id'); -
post-update-addon-gravity-forms/tags/1.1.3/feed-settings.php
r2633849 r2662026 87 87 'type' => 'custom_taxonomy_field_type', 88 88 ), 89 array( 90 'label' => __('Custom Taxonomies', $this->_slug), 91 'name' => 'custom_tax_settings', 92 'type' => 'dynamic_field_map', 93 'field_map' => (function() { 94 $tax = get_taxonomies(array(), 'objects'); 95 $tax = array_map(function($i) { 96 return array( 97 'label' => $i->label, 98 'value' => $i->name 99 ); 100 }, $tax); 101 //var_dump($tax); 102 return $tax; 103 })() 104 ), 105 array( 106 'label' => __(' Custom Taxonomies Override Mode', $this->_slug), 107 'name' => 'custom_tax_override_mode', 108 'type' => 'select', 109 'choices' => array( 110 array( 111 'label' => __('Override if not empty', $this->_slug), 112 'value' => 'override_not_empty' 113 ), 114 array( 115 'label' => __('Override always', $this->_slug), 116 'value' => 'override_always' 117 ), 118 array( 119 'label' => __('Append', $this->_slug), 120 'value' => 'append' 121 ), 122 ) 123 ) 89 124 ) 90 125 ), -
post-update-addon-gravity-forms/tags/1.1.3/post-update-addon-gravity-forms.php
r2636641 r2662026 3 3 Plugin Name: Post Update Addon - Gravity Forms 4 4 Description: Update/Edit a post or a custom post type with Gravity Forms. 5 Version: 1.1. 25 Version: 1.1.3 6 6 Author: Alex Chernov 7 7 Author URI: https://alexchernov.com 8 8 Text Domain: post-update-addon-gravity-forms 9 9 */ 10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1. 2');10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.3'); 11 11 12 12 add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5); -
post-update-addon-gravity-forms/tags/1.1.3/readme.txt
r2636641 r2662026 4 4 Requires at least: 5.4.0 5 5 Tested up to: 5.8.2 6 Stable tag: 1.1. 26 Stable tag: 1.1.3 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 21 21 - (Required) Configure "Post ID" (number, insert merge tag or current page/post id) 22 22 - Configure Post Settings (Author ID, Post Status) 23 - Configure Tags & Categories 23 - Configure Tags & Categories & Custom Taxonomies 24 24 - Configure Post Title and Content manually or insert merge tags 25 25 - Configure Featured Image … … 32 32 * Update Author and Status 33 33 * Update "Post Title" and "Post Content" 34 * Update "Tags" and "Categories"34 * Update "Tags", "Categories" and "Custom Taxonomies" 35 35 * Update "Featured Image" 36 36 * Update "Post Custom Fields" … … 49 49 50 50 == Changelog == 51 52 = 1.1.3 = 53 - Support for custom taxonomies 51 54 52 55 = 1.1.2 = -
post-update-addon-gravity-forms/trunk/class-post-update-addon.php
r2636641 r2662026 78 78 $this->process_taxonomy($feed, $entry, 'category', $post_id); 79 79 $this->process_taxonomy($feed, $entry, 'post_tag', $post_id); 80 $this->process_custom_taxonomies($feed, $entry, $post_id); 80 81 81 82 // Updating meta fields … … 172 173 } 173 174 175 function process_custom_taxonomies($feed, $entry, $post_id) { 176 $tax_map = $this->get_dynamic_field_map_fields($feed, 'custom_tax_settings'); 177 $tax_mode = rgars($feed, 'meta/custom_tax_override_mode'); 178 179 foreach($tax_map as $tax_slug => $tax_field_id) { 180 $new_tax_value = trim(rgar($entry, $tax_field_id)); 181 if($new_tax_value === '' && $tax_mode === 'override_not_empty') continue; 182 wp_set_object_terms($post_id, explode(',', $new_tax_value), $tax_slug, $tax_mode === 'append'); 183 } 184 } 185 174 186 function prepare_author_id($feed, $entry, $form, &$postarr) { 175 187 $author_id = rgars($feed, 'meta/author_id'); -
post-update-addon-gravity-forms/trunk/feed-settings.php
r2633849 r2662026 87 87 'type' => 'custom_taxonomy_field_type', 88 88 ), 89 array( 90 'label' => __('Custom Taxonomies', $this->_slug), 91 'name' => 'custom_tax_settings', 92 'type' => 'dynamic_field_map', 93 'field_map' => (function() { 94 $tax = get_taxonomies(array(), 'objects'); 95 $tax = array_map(function($i) { 96 return array( 97 'label' => $i->label, 98 'value' => $i->name 99 ); 100 }, $tax); 101 //var_dump($tax); 102 return $tax; 103 })() 104 ), 105 array( 106 'label' => __(' Custom Taxonomies Override Mode', $this->_slug), 107 'name' => 'custom_tax_override_mode', 108 'type' => 'select', 109 'choices' => array( 110 array( 111 'label' => __('Override if not empty', $this->_slug), 112 'value' => 'override_not_empty' 113 ), 114 array( 115 'label' => __('Override always', $this->_slug), 116 'value' => 'override_always' 117 ), 118 array( 119 'label' => __('Append', $this->_slug), 120 'value' => 'append' 121 ), 122 ) 123 ) 89 124 ) 90 125 ), -
post-update-addon-gravity-forms/trunk/post-update-addon-gravity-forms.php
r2636641 r2662026 3 3 Plugin Name: Post Update Addon - Gravity Forms 4 4 Description: Update/Edit a post or a custom post type with Gravity Forms. 5 Version: 1.1. 25 Version: 1.1.3 6 6 Author: Alex Chernov 7 7 Author URI: https://alexchernov.com 8 8 Text Domain: post-update-addon-gravity-forms 9 9 */ 10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1. 2');10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.3'); 11 11 12 12 add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5); -
post-update-addon-gravity-forms/trunk/readme.txt
r2636641 r2662026 4 4 Requires at least: 5.4.0 5 5 Tested up to: 5.8.2 6 Stable tag: 1.1. 26 Stable tag: 1.1.3 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 21 21 - (Required) Configure "Post ID" (number, insert merge tag or current page/post id) 22 22 - Configure Post Settings (Author ID, Post Status) 23 - Configure Tags & Categories 23 - Configure Tags & Categories & Custom Taxonomies 24 24 - Configure Post Title and Content manually or insert merge tags 25 25 - Configure Featured Image … … 32 32 * Update Author and Status 33 33 * Update "Post Title" and "Post Content" 34 * Update "Tags" and "Categories"34 * Update "Tags", "Categories" and "Custom Taxonomies" 35 35 * Update "Featured Image" 36 36 * Update "Post Custom Fields" … … 49 49 50 50 == Changelog == 51 52 = 1.1.3 = 53 - Support for custom taxonomies 51 54 52 55 = 1.1.2 =
Note: See TracChangeset
for help on using the changeset viewer.