Changeset 2893200
- Timestamp:
- 04/04/2023 02:10:09 AM (3 years ago)
- Location:
- restful-syndication
- Files:
-
- 2 edited
- 3 copied
-
tags/1.4.0 (copied) (copied from restful-syndication/trunk)
-
tags/1.4.0/index.php (copied) (copied from restful-syndication/trunk/index.php) (6 diffs)
-
tags/1.4.0/readme.txt (copied) (copied from restful-syndication/trunk/readme.txt) (2 diffs)
-
trunk/index.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
restful-syndication/tags/1.4.0/index.php
r2871614 r2893200 4 4 Plugin URI: https://mediarealm.com.au/ 5 5 Description: Import content from the Wordpress REST API on another Wordpress site 6 Version: 1. 3.06 Version: 1.4.0 7 7 Author: Media Realm 8 8 Author URI: https://www.mediarealm.com.au/ … … 65 65 "type" => "checkbox", 66 66 ), 67 "automatic_category" => array( 68 "title" => "Add specific category to every incoming post", 69 "type" => "select", 70 "options" => array(0 => '') 71 ), 67 72 "yoast_noindex" => array( 68 73 "title" => "Always Enable Yoast No-Index?", … … 146 151 foreach($users as $user_id) { 147 152 $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; 148 162 } 149 163 … … 584 598 // Find local matching categories, or create missing ones 585 599 $categories = array(); 600 601 if(isset($options['automatic_category']) && !empty($options['automatic_category']) && $options['automatic_category'] !== 0) { 602 $categories[] = $options['automatic_category']; 603 } 586 604 587 605 if(isset($post['_links']['wp:term'])) { … … 957 975 } 958 976 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 959 989 if(file_exists($file)) { 960 990 // File already exists - get the attachment ID … … 985 1015 $attach_data = wp_generate_attachment_metadata($attach_id, $file); 986 1016 wp_update_attachment_metadata($attach_id, $attach_data); 1017 1018 update_post_meta($attach_id, 'restfulsyndication_original_url', $url); 987 1019 988 1020 if(!file_exists($file)) { -
restful-syndication/tags/1.4.0/readme.txt
r2871614 r2893200 4 4 Requires at least: 5.9.5 5 5 Tested up to: 6.1.1 6 Requires PHP: 7. 4.06 Requires PHP: 7.3.0 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 51 51 = Do you provide support? = 52 52 53 Commercial support may beavailable from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/53 Commercial support is available from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/ 54 54 55 55 = Can you add a certain feature? = 56 56 57 You may be able to sponsor feature development. Email us here with your feature request and budget: https://mediarealm.com.au/contact/57 You may be able to sponsor feature development. Email us here with your feature request: https://mediarealm.com.au/contact/ 58 58 59 59 == 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. 60 65 61 66 = 1.3.0 = -
restful-syndication/trunk/index.php
r2871614 r2893200 4 4 Plugin URI: https://mediarealm.com.au/ 5 5 Description: Import content from the Wordpress REST API on another Wordpress site 6 Version: 1. 3.06 Version: 1.4.0 7 7 Author: Media Realm 8 8 Author URI: https://www.mediarealm.com.au/ … … 65 65 "type" => "checkbox", 66 66 ), 67 "automatic_category" => array( 68 "title" => "Add specific category to every incoming post", 69 "type" => "select", 70 "options" => array(0 => '') 71 ), 67 72 "yoast_noindex" => array( 68 73 "title" => "Always Enable Yoast No-Index?", … … 146 151 foreach($users as $user_id) { 147 152 $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; 148 162 } 149 163 … … 584 598 // Find local matching categories, or create missing ones 585 599 $categories = array(); 600 601 if(isset($options['automatic_category']) && !empty($options['automatic_category']) && $options['automatic_category'] !== 0) { 602 $categories[] = $options['automatic_category']; 603 } 586 604 587 605 if(isset($post['_links']['wp:term'])) { … … 957 975 } 958 976 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 959 989 if(file_exists($file)) { 960 990 // File already exists - get the attachment ID … … 985 1015 $attach_data = wp_generate_attachment_metadata($attach_id, $file); 986 1016 wp_update_attachment_metadata($attach_id, $attach_data); 1017 1018 update_post_meta($attach_id, 'restfulsyndication_original_url', $url); 987 1019 988 1020 if(!file_exists($file)) { -
restful-syndication/trunk/readme.txt
r2871614 r2893200 4 4 Requires at least: 5.9.5 5 5 Tested up to: 6.1.1 6 Requires PHP: 7. 4.06 Requires PHP: 7.3.0 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 51 51 = Do you provide support? = 52 52 53 Commercial support may beavailable from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/53 Commercial support is available from Media Realm (for a fee). Email us here: https://mediarealm.com.au/contact/ 54 54 55 55 = Can you add a certain feature? = 56 56 57 You may be able to sponsor feature development. Email us here with your feature request and budget: https://mediarealm.com.au/contact/57 You may be able to sponsor feature development. Email us here with your feature request: https://mediarealm.com.au/contact/ 58 58 59 59 == 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. 60 65 61 66 = 1.3.0 =
Note: See TracChangeset
for help on using the changeset viewer.