Plugin Directory

Changeset 2893200


Ignore:
Timestamp:
04/04/2023 02:10:09 AM (3 years ago)
Author:
anthonyeden
Message:

Release v1.4.0

Location:
restful-syndication
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • restful-syndication/tags/1.4.0/index.php

    r2871614 r2893200  
    44Plugin URI: https://mediarealm.com.au/
    55Description: Import content from the Wordpress REST API on another Wordpress site
    6 Version: 1.3.0
     6Version: 1.4.0
    77Author: Media Realm
    88Author URI: https://www.mediarealm.com.au/
     
    6565            "type" => "checkbox",
    6666        ),
     67        "automatic_category" => array(
     68            "title" => "Add specific category to every incoming post",
     69            "type" => "select",
     70            "options" => array(0 => '')
     71        ),
    6772        "yoast_noindex" => array(
    6873            "title" => "Always Enable Yoast No-Index?",
     
    146151        foreach($users as $user_id) {
    147152            $this->settings['default_author']['options'][$user_id->ID] = $user_id->display_name;
     153        }
     154
     155        // Add a list of categories
     156        $categories = get_terms(array(
     157            'taxonomy' => 'category',
     158            'hide_empty' => false,
     159        ));
     160        foreach($categories as $category) {
     161            $this->settings['automatic_category']['options'][$category->term_id] = $category->name;
    148162        }
    149163
     
    584598        // Find local matching categories, or create missing ones
    585599        $categories = array();
     600
     601        if(isset($options['automatic_category']) && !empty($options['automatic_category']) && $options['automatic_category'] !== 0) {
     602            $categories[] = $options['automatic_category'];
     603        }
    586604
    587605        if(isset($post['_links']['wp:term'])) {
     
    957975        }
    958976
     977        // Lookup existing file by meta field
     978        $search_existing = get_posts(array(
     979            'post_type'      => 'attachment',
     980            'meta_key'       => 'restfulsyndication_original_url',
     981            'meta_value'     => $url,
     982            'posts_per_page' => 1,
     983        ));
     984
     985        if(is_array($search_existing) && count($search_existing) > 0 && isset($search_existing[0]->ID)) {
     986            return $search_existing[0]->ID;
     987        }
     988
    959989        if(file_exists($file)) {
    960990            // File already exists - get the attachment ID
     
    9851015            $attach_data = wp_generate_attachment_metadata($attach_id, $file);
    9861016            wp_update_attachment_metadata($attach_id, $attach_data);
     1017
     1018            update_post_meta($attach_id, 'restfulsyndication_original_url', $url);
    9871019
    9881020            if(!file_exists($file)) {
  • restful-syndication/tags/1.4.0/readme.txt

    r2871614 r2893200  
    44Requires at least: 5.9.5
    55Tested up to: 6.1.1
    6 Requires PHP: 7.4.0
     6Requires PHP: 7.3.0
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5151= Do you provide support? =
    5252
    53 Commercial support may be available from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/
     53Commercial support is available from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/
    5454
    5555= Can you add a certain feature? =
    5656
    57 You may be able to sponsor feature development. Email us here with your feature request and budget: https://mediarealm.com.au/contact/
     57You may be able to sponsor feature development. Email us here with your feature request: https://mediarealm.com.au/contact/
    5858
    5959== Changelog ==
     60
     61= 1.4.0 =
     62
     63* Adds an option for add a specific category to every incoming post
     64* Tracks syndicated media in a meta field, instead of relying on the filename.
    6065
    6166= 1.3.0 =
  • restful-syndication/trunk/index.php

    r2871614 r2893200  
    44Plugin URI: https://mediarealm.com.au/
    55Description: Import content from the Wordpress REST API on another Wordpress site
    6 Version: 1.3.0
     6Version: 1.4.0
    77Author: Media Realm
    88Author URI: https://www.mediarealm.com.au/
     
    6565            "type" => "checkbox",
    6666        ),
     67        "automatic_category" => array(
     68            "title" => "Add specific category to every incoming post",
     69            "type" => "select",
     70            "options" => array(0 => '')
     71        ),
    6772        "yoast_noindex" => array(
    6873            "title" => "Always Enable Yoast No-Index?",
     
    146151        foreach($users as $user_id) {
    147152            $this->settings['default_author']['options'][$user_id->ID] = $user_id->display_name;
     153        }
     154
     155        // Add a list of categories
     156        $categories = get_terms(array(
     157            'taxonomy' => 'category',
     158            'hide_empty' => false,
     159        ));
     160        foreach($categories as $category) {
     161            $this->settings['automatic_category']['options'][$category->term_id] = $category->name;
    148162        }
    149163
     
    584598        // Find local matching categories, or create missing ones
    585599        $categories = array();
     600
     601        if(isset($options['automatic_category']) && !empty($options['automatic_category']) && $options['automatic_category'] !== 0) {
     602            $categories[] = $options['automatic_category'];
     603        }
    586604
    587605        if(isset($post['_links']['wp:term'])) {
     
    957975        }
    958976
     977        // Lookup existing file by meta field
     978        $search_existing = get_posts(array(
     979            'post_type'      => 'attachment',
     980            'meta_key'       => 'restfulsyndication_original_url',
     981            'meta_value'     => $url,
     982            'posts_per_page' => 1,
     983        ));
     984
     985        if(is_array($search_existing) && count($search_existing) > 0 && isset($search_existing[0]->ID)) {
     986            return $search_existing[0]->ID;
     987        }
     988
    959989        if(file_exists($file)) {
    960990            // File already exists - get the attachment ID
     
    9851015            $attach_data = wp_generate_attachment_metadata($attach_id, $file);
    9861016            wp_update_attachment_metadata($attach_id, $attach_data);
     1017
     1018            update_post_meta($attach_id, 'restfulsyndication_original_url', $url);
    9871019
    9881020            if(!file_exists($file)) {
  • restful-syndication/trunk/readme.txt

    r2871614 r2893200  
    44Requires at least: 5.9.5
    55Tested up to: 6.1.1
    6 Requires PHP: 7.4.0
     6Requires PHP: 7.3.0
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5151= Do you provide support? =
    5252
    53 Commercial support may be available from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/
     53Commercial support is available from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/
    5454
    5555= Can you add a certain feature? =
    5656
    57 You may be able to sponsor feature development. Email us here with your feature request and budget: https://mediarealm.com.au/contact/
     57You may be able to sponsor feature development. Email us here with your feature request: https://mediarealm.com.au/contact/
    5858
    5959== Changelog ==
     60
     61= 1.4.0 =
     62
     63* Adds an option for add a specific category to every incoming post
     64* Tracks syndicated media in a meta field, instead of relying on the filename.
    6065
    6166= 1.3.0 =
Note: See TracChangeset for help on using the changeset viewer.