Changeset 2636641
- Timestamp:
- 11/29/2021 05:26:07 AM (4 years ago)
- Location:
- post-update-addon-gravity-forms
- Files:
-
- 4 edited
- 5 copied
-
assets/screenshot-1.png (modified) (previous)
-
tags/1.1.2 (copied) (copied from post-update-addon-gravity-forms/trunk)
-
tags/1.1.2/class-post-update-addon.php (copied) (copied from post-update-addon-gravity-forms/trunk/class-post-update-addon.php) (2 diffs)
-
tags/1.1.2/feed-settings.php (copied) (copied from post-update-addon-gravity-forms/trunk/feed-settings.php)
-
tags/1.1.2/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.2/readme.txt (copied) (copied from post-update-addon-gravity-forms/trunk/readme.txt) (3 diffs)
-
trunk/class-post-update-addon.php (modified) (2 diffs)
-
trunk/post-update-addon-gravity-forms.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-update-addon-gravity-forms/tags/1.1.2/class-post-update-addon.php
r2633849 r2636641 106 106 return; 107 107 } 108 $file = str_replace(get_site_url() . '/', ABSPATH, $new_featured_image); 109 //var_dump($file); 110 $filename = basename($file); 111 //var_dump($filename); 112 113 $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); 108 $upload_path = GFFormsModel::get_upload_path($entry['form_id']); 109 $upload_url = GFFormsModel::get_upload_url($entry['form_id']); 110 $file_path = str_replace($upload_url, $upload_path, $new_featured_image); 111 112 $filename = basename($file_path); 113 114 $upload_file = wp_upload_bits($filename, null, file_get_contents($file_path)); 114 115 if(!$upload_file['error']) { 115 116 $wp_filetype = wp_check_filetype($filename, null ); … … 141 142 $metaMap = $this->get_dynamic_field_map_fields($feed, 'meta_field_map'); 142 143 foreach($metaMap as $target_meta_key => $source_field_id) { 143 $form_field_value = rgar($entry, $source_field_id); 144 $form_field_value = ''; 145 if(array_key_exists($source_field_id . '.1', $entry)) { 146 // this is composite GF value, checkbox or similar 147 $form_field_value = array(); 148 foreach($entry as $key => $value) { 149 if($value === '') continue; // non empty values 150 if(strpos($key, $source_field_id . '.') !== 0) continue; // that belong to our field 151 array_push($form_field_value, rgar($entry, $key)); 152 } 153 } else { 154 // this is just a plain value 155 $form_field_value = rgar($entry, $source_field_id); 156 } 144 157 if($update_non_empty_meta_fields_only && $form_field_value === '') continue; 145 158 update_post_meta($post_id, $target_meta_key, $form_field_value); -
post-update-addon-gravity-forms/tags/1.1.2/post-update-addon-gravity-forms.php
r2633849 r2636641 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. 15 Version: 1.1.2 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. 1');10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.2'); 11 11 12 12 add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5); -
post-update-addon-gravity-forms/tags/1.1.2/readme.txt
r2633849 r2636641 4 4 Requires at least: 5.4.0 5 5 Tested up to: 5.8.2 6 Stable tag: 1.1. 16 Stable tag: 1.1.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 19 19 - In form settings open "Post Update" 20 20 - Press "Add New" 21 - (Required) Configure "Post ID" manually, from merge tag or use current page/post id 22 - Configure new Author ID 23 - Configure new Post Status 21 - (Required) Configure "Post ID" (number, insert merge tag or current page/post id) 22 - Configure Post Settings (Author ID, Post Status) 23 - Configure Tags & Categories 24 - Configure Post Title and Content manually or insert merge tags 24 25 - Configure Featured Image 25 - Configure Tags & Categories 26 - Configure Post title and desctiption manually or insert merge tags 27 - Leave any of above empty to avoid changes 28 - Configure your custom fields 29 - Configure conditional logic 26 - Configure Custom fields 27 - Configure Conditional logic 30 28 - Press "Save Settings" 31 29 32 30 Features: 33 31 34 * Update "Post Author" 35 * Update "Post Status" 36 * Update "Post Title" 37 * Update "Post Content" 32 * Update Author and Status 33 * Update "Post Title" and "Post Content" 34 * Update "Tags" and "Categories" 38 35 * Update "Featured Image" 39 * Update "Tags" and "Categories"40 36 * Update "Post Custom Fields" 41 * Merge tags support 37 * Optional update if the field is empty 38 * Combine values with merge tags 42 39 * Conditional logic support 43 40 … … 52 49 53 50 == Changelog == 51 52 = 1.1.2 = 53 - Support for checkboxes and similar fields 54 - Featured image update bugfix 55 56 = 1.1.1 = 57 - Update only non-empty fields option 54 58 55 59 = 1.1.0 = -
post-update-addon-gravity-forms/trunk/class-post-update-addon.php
r2633849 r2636641 106 106 return; 107 107 } 108 $file = str_replace(get_site_url() . '/', ABSPATH, $new_featured_image); 109 //var_dump($file); 110 $filename = basename($file); 111 //var_dump($filename); 112 113 $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); 108 $upload_path = GFFormsModel::get_upload_path($entry['form_id']); 109 $upload_url = GFFormsModel::get_upload_url($entry['form_id']); 110 $file_path = str_replace($upload_url, $upload_path, $new_featured_image); 111 112 $filename = basename($file_path); 113 114 $upload_file = wp_upload_bits($filename, null, file_get_contents($file_path)); 114 115 if(!$upload_file['error']) { 115 116 $wp_filetype = wp_check_filetype($filename, null ); … … 141 142 $metaMap = $this->get_dynamic_field_map_fields($feed, 'meta_field_map'); 142 143 foreach($metaMap as $target_meta_key => $source_field_id) { 143 $form_field_value = rgar($entry, $source_field_id); 144 $form_field_value = ''; 145 if(array_key_exists($source_field_id . '.1', $entry)) { 146 // this is composite GF value, checkbox or similar 147 $form_field_value = array(); 148 foreach($entry as $key => $value) { 149 if($value === '') continue; // non empty values 150 if(strpos($key, $source_field_id . '.') !== 0) continue; // that belong to our field 151 array_push($form_field_value, rgar($entry, $key)); 152 } 153 } else { 154 // this is just a plain value 155 $form_field_value = rgar($entry, $source_field_id); 156 } 144 157 if($update_non_empty_meta_fields_only && $form_field_value === '') continue; 145 158 update_post_meta($post_id, $target_meta_key, $form_field_value); -
post-update-addon-gravity-forms/trunk/post-update-addon-gravity-forms.php
r2633849 r2636641 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. 15 Version: 1.1.2 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. 1');10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.2'); 11 11 12 12 add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5); -
post-update-addon-gravity-forms/trunk/readme.txt
r2633849 r2636641 4 4 Requires at least: 5.4.0 5 5 Tested up to: 5.8.2 6 Stable tag: 1.1. 16 Stable tag: 1.1.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 19 19 - In form settings open "Post Update" 20 20 - Press "Add New" 21 - (Required) Configure "Post ID" manually, from merge tag or use current page/post id 22 - Configure new Author ID 23 - Configure new Post Status 21 - (Required) Configure "Post ID" (number, insert merge tag or current page/post id) 22 - Configure Post Settings (Author ID, Post Status) 23 - Configure Tags & Categories 24 - Configure Post Title and Content manually or insert merge tags 24 25 - Configure Featured Image 25 - Configure Tags & Categories 26 - Configure Post title and desctiption manually or insert merge tags 27 - Leave any of above empty to avoid changes 28 - Configure your custom fields 29 - Configure conditional logic 26 - Configure Custom fields 27 - Configure Conditional logic 30 28 - Press "Save Settings" 31 29 32 30 Features: 33 31 34 * Update "Post Author" 35 * Update "Post Status" 36 * Update "Post Title" 37 * Update "Post Content" 32 * Update Author and Status 33 * Update "Post Title" and "Post Content" 34 * Update "Tags" and "Categories" 38 35 * Update "Featured Image" 39 * Update "Tags" and "Categories"40 36 * Update "Post Custom Fields" 41 * Merge tags support 37 * Optional update if the field is empty 38 * Combine values with merge tags 42 39 * Conditional logic support 43 40 … … 52 49 53 50 == Changelog == 51 52 = 1.1.2 = 53 - Support for checkboxes and similar fields 54 - Featured image update bugfix 55 56 = 1.1.1 = 57 - Update only non-empty fields option 54 58 55 59 = 1.1.0 =
Note: See TracChangeset
for help on using the changeset viewer.