Plugin Directory

Changeset 2636641


Ignore:
Timestamp:
11/29/2021 05:26:07 AM (4 years ago)
Author:
alexusblack
Message:

version 1.1.2 release

Location:
post-update-addon-gravity-forms
Files:
4 edited
5 copied

Legend:

Unmodified
Added
Removed
  • post-update-addon-gravity-forms/tags/1.1.2/class-post-update-addon.php

    r2633849 r2636641  
    106106      return;
    107107    }
    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));
    114115    if(!$upload_file['error']) {
    115116      $wp_filetype = wp_check_filetype($filename, null );
     
    141142    $metaMap = $this->get_dynamic_field_map_fields($feed, 'meta_field_map');
    142143    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      }
    144157      if($update_non_empty_meta_fields_only && $form_field_value === '') continue;
    145158      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  
    33Plugin Name: Post Update Addon - Gravity Forms
    44Description: Update/Edit a post or a custom post type with Gravity Forms.
    5 Version: 1.1.1
     5Version: 1.1.2
    66Author: Alex Chernov
    77Author URI: https://alexchernov.com
    88Text Domain: post-update-addon-gravity-forms
    99*/
    10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.1');
     10define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.2');
    1111
    1212add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5);
  • post-update-addon-gravity-forms/tags/1.1.2/readme.txt

    r2633849 r2636641  
    44Requires at least: 5.4.0
    55Tested up to: 5.8.2
    6 Stable tag: 1.1.1
     6Stable tag: 1.1.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    1919- In form settings open "Post Update"
    2020- 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
    2425- 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
    3028- Press "Save Settings"
    3129
    3230Features:
    3331
    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"
    3835* Update "Featured Image"
    39 * Update "Tags" and "Categories"
    4036* Update "Post Custom Fields"
    41 * Merge tags support
     37* Optional update if the field is empty
     38* Combine values with merge tags
    4239* Conditional logic support
    4340
     
    5249
    5350== 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
    5458
    5559= 1.1.0 =
  • post-update-addon-gravity-forms/trunk/class-post-update-addon.php

    r2633849 r2636641  
    106106      return;
    107107    }
    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));
    114115    if(!$upload_file['error']) {
    115116      $wp_filetype = wp_check_filetype($filename, null );
     
    141142    $metaMap = $this->get_dynamic_field_map_fields($feed, 'meta_field_map');
    142143    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      }
    144157      if($update_non_empty_meta_fields_only && $form_field_value === '') continue;
    145158      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  
    33Plugin Name: Post Update Addon - Gravity Forms
    44Description: Update/Edit a post or a custom post type with Gravity Forms.
    5 Version: 1.1.1
     5Version: 1.1.2
    66Author: Alex Chernov
    77Author URI: https://alexchernov.com
    88Text Domain: post-update-addon-gravity-forms
    99*/
    10 define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.1');
     10define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.2');
    1111
    1212add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5);
  • post-update-addon-gravity-forms/trunk/readme.txt

    r2633849 r2636641  
    44Requires at least: 5.4.0
    55Tested up to: 5.8.2
    6 Stable tag: 1.1.1
     6Stable tag: 1.1.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    1919- In form settings open "Post Update"
    2020- 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
    2425- 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
    3028- Press "Save Settings"
    3129
    3230Features:
    3331
    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"
    3835* Update "Featured Image"
    39 * Update "Tags" and "Categories"
    4036* Update "Post Custom Fields"
    41 * Merge tags support
     37* Optional update if the field is empty
     38* Combine values with merge tags
    4239* Conditional logic support
    4340
     
    5249
    5350== 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
    5458
    5559= 1.1.0 =
Note: See TracChangeset for help on using the changeset viewer.