Skip to content

Commit

Permalink
v1.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tamw-wnet committed Feb 13, 2024
2 parents bcdddfe + f8c537f commit 267af0a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -70,6 +70,9 @@ NPR Stories having got gotten
## Changelog

<!-- copy from readme.txt to here -->
### 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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
9 changes: 7 additions & 2 deletions ds-npr-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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 '<link rel="canonical" href="' . esc_url( $original_url ) . '" />' . "\n";
} elseif ( function_exists( 'get_coauthors' ) ) {
$byline = coauthors( ', ', ', ', '', '', false );
} else {
Expand Down Expand Up @@ -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');

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 267af0a

Please sign in to comment.