diff --git a/README.md b/README.md index d5adda8..b140fb3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A collection of tools for publishing from and to NPR's Story API. [Find this plu - Original developers: NPRDS, INN Labs - Requires at least: 3.8.14 - Tested up to: 6.4.1 -- Stable tag: 1.9.5.2 +- Stable tag: 1.9.6 - License: GPLv2 - License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -70,6 +70,9 @@ NPR Stories having got gotten ## Changelog +### V1.9.6 +* Articles imported from the API will now show the original article URL as the canonical URL in the header + ### V1.9.5.1 * Adding `'no_found_posts' => false` to the query in `update_posts_from_stories()` for greater MySQL 8 compatability. Will also help on sites with large archives of posts * Adding support for admin messaging regarding the sunsetting of the NPR Story API and this plugin. Will actually roll the messaging out once the successor plugin (NPR CDS) is available in the plugin directory diff --git a/composer.json b/composer.json index 0dec30c..06455a8 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "license" : "GPL-2.0+", "require": {}, "dist": { - "url": "https://github.com/OpenPublicMedia/nprapi-wordpress/archive/refs/tags/v1.9.5.2.zip", + "url": "https://github.com/OpenPublicMedia/nprapi-wordpress/archive/refs/tags/v1.9.6.zip", "type": "zip" }, "authors": [ diff --git a/ds-npr-api.php b/ds-npr-api.php index ea44b31..e9b2bb0 100644 --- a/ds-npr-api.php +++ b/ds-npr-api.php @@ -2,7 +2,7 @@ /** * Plugin Name: NPR Story API * Description: A collection of tools for reusing content from NPR.org, now maintained and updated by NPR member station developers - * Version: 1.9.5.2 + * Version: 1.9.6 * Author: Open Public Media * License: GPLv2 */ @@ -226,6 +226,11 @@ function nprstory_add_header_meta() { $npr_retrieved_story = get_post_meta( $id, 'npr_retrieved_story', 1 ); if ( $npr_retrieved_story == 1 ) { $byline = get_post_meta( $id, 'npr_byline', 1 ); + if ( function_exists( 'rel_canonical' ) ) { + remove_action( 'wp_head', 'rel_canonical' ); + } + $original_url = get_post_meta( $id, NPR_HTML_LINK_META_KEY, 1 ); + echo '' . "\n"; } elseif ( function_exists( 'get_coauthors' ) ) { $byline = coauthors( ', ', ', ', '', '', false ); } else { @@ -257,7 +262,7 @@ function nprstory_add_header_meta() { } } } -add_action( 'wp_head', 'nprstory_add_header_meta', 100 ); +add_action( 'wp_head', 'nprstory_add_header_meta', 9 ); // add_action('admin_notices', 'nprstory_cds_plugin_admin_notice'); diff --git a/readme.txt b/readme.txt index 19cf3d6..cbadb61 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.npr.org/series/750002/support-public-radio Tags: npr, news, public radio, api Requires at least: 3.8.14 Tested up to: 6.0 -Stable tag: 1.9.5.2 +Stable tag: 1.9.6 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: nprapi @@ -70,6 +70,9 @@ NPR Stories having got gotten == Changelog == += V1.9.6 = +* Articles imported from the API will now show the original article URL as the canonical URL in the header + = V1.9.5.1 = * Adding `'no_found_posts' => false` to the query in `update_posts_from_stories()` for greater MySQL 8 compatability. Will also help on sites with large archives of posts * Adding support for admin messaging regarding the sunsetting of the NPR Story API and this plugin. Will actually roll the messaging out once the successor plugin (NPR CDS) is available in the plugin directory