Plugin Directory

Changeset 2662026


Ignore:
Timestamp:
01/23/2022 06:03:33 AM (4 years ago)
Author:
alexusblack
Message:

version 1.1.3

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

Legend:

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

    r2636641 r2662026  
    7878    $this->process_taxonomy($feed, $entry, 'category', $post_id);
    7979    $this->process_taxonomy($feed, $entry, 'post_tag', $post_id);
     80    $this->process_custom_taxonomies($feed, $entry, $post_id);
    8081
    8182    // Updating meta fields
     
    172173  }
    173174
     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
    174186  function prepare_author_id($feed, $entry, $form, &$postarr) {
    175187    $author_id = rgars($feed, 'meta/author_id');
  • post-update-addon-gravity-forms/tags/1.1.3/feed-settings.php

    r2633849 r2662026  
    8787            'type' => 'custom_taxonomy_field_type',
    8888          ),
     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          )
    89124        )
    90125      ),
  • post-update-addon-gravity-forms/tags/1.1.3/post-update-addon-gravity-forms.php

    r2636641 r2662026  
    33Plugin Name: Post Update Addon - Gravity Forms
    44Description: Update/Edit a post or a custom post type with Gravity Forms.
    5 Version: 1.1.2
     5Version: 1.1.3
    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.2');
     10define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.3');
    1111
    1212add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5);
  • post-update-addon-gravity-forms/tags/1.1.3/readme.txt

    r2636641 r2662026  
    44Requires at least: 5.4.0
    55Tested up to: 5.8.2
    6 Stable tag: 1.1.2
     6Stable tag: 1.1.3
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    2121- (Required) Configure "Post ID" (number, insert merge tag or current page/post id)
    2222- Configure Post Settings (Author ID, Post Status)
    23 - Configure Tags & Categories
     23- Configure Tags & Categories & Custom Taxonomies
    2424- Configure Post Title and Content manually or insert merge tags
    2525- Configure Featured Image
     
    3232* Update Author and Status
    3333* Update "Post Title" and "Post Content"
    34 * Update "Tags" and "Categories"
     34* Update "Tags", "Categories" and "Custom Taxonomies"
    3535* Update "Featured Image"
    3636* Update "Post Custom Fields"
     
    4949
    5050== Changelog ==
     51
     52= 1.1.3 =
     53- Support for custom taxonomies
    5154
    5255= 1.1.2 =
  • post-update-addon-gravity-forms/trunk/class-post-update-addon.php

    r2636641 r2662026  
    7878    $this->process_taxonomy($feed, $entry, 'category', $post_id);
    7979    $this->process_taxonomy($feed, $entry, 'post_tag', $post_id);
     80    $this->process_custom_taxonomies($feed, $entry, $post_id);
    8081
    8182    // Updating meta fields
     
    172173  }
    173174
     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
    174186  function prepare_author_id($feed, $entry, $form, &$postarr) {
    175187    $author_id = rgars($feed, 'meta/author_id');
  • post-update-addon-gravity-forms/trunk/feed-settings.php

    r2633849 r2662026  
    8787            'type' => 'custom_taxonomy_field_type',
    8888          ),
     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          )
    89124        )
    90125      ),
  • post-update-addon-gravity-forms/trunk/post-update-addon-gravity-forms.php

    r2636641 r2662026  
    33Plugin Name: Post Update Addon - Gravity Forms
    44Description: Update/Edit a post or a custom post type with Gravity Forms.
    5 Version: 1.1.2
     5Version: 1.1.3
    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.2');
     10define('ACGF_POST_UPDATE_ADDON_VERSION', '1.1.3');
    1111
    1212add_action('gform_loaded', array('ACGF_PostUpdate_AddOn_Bootstrap', 'load'), 5);
  • post-update-addon-gravity-forms/trunk/readme.txt

    r2636641 r2662026  
    44Requires at least: 5.4.0
    55Tested up to: 5.8.2
    6 Stable tag: 1.1.2
     6Stable tag: 1.1.3
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    2121- (Required) Configure "Post ID" (number, insert merge tag or current page/post id)
    2222- Configure Post Settings (Author ID, Post Status)
    23 - Configure Tags & Categories
     23- Configure Tags & Categories & Custom Taxonomies
    2424- Configure Post Title and Content manually or insert merge tags
    2525- Configure Featured Image
     
    3232* Update Author and Status
    3333* Update "Post Title" and "Post Content"
    34 * Update "Tags" and "Categories"
     34* Update "Tags", "Categories" and "Custom Taxonomies"
    3535* Update "Featured Image"
    3636* Update "Post Custom Fields"
     
    4949
    5050== Changelog ==
     51
     52= 1.1.3 =
     53- Support for custom taxonomies
    5154
    5255= 1.1.2 =
Note: See TracChangeset for help on using the changeset viewer.