diff --git a/README.md b/README.md index 8844434..7d3d4e7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Requires at least: 3.8.14 Tested up to: 4.5.2 -Stable tag: 1.6 +Stable tag: 1.7 License: GPLv2 @@ -30,7 +30,6 @@ The WordPress plugin is being developed as an Open Source plugin by NPR. If you 2. Activate the plugin through the 'Plugins' screen in WordPress 3. Use the Settings->NPR API screen to configure the plugin. Begin by entering your API Key, then add your Push URL and Org ID. - == Frequently Asked Questions == = Can anyone get an NPR API Key? = @@ -43,11 +42,11 @@ Push requires an Organization ID in the NPR API, which is typically given out to = Where can I find NPR's documentation on the NPR API? = -There is some documentation in the NPR API site: [https://www.npr.org/api/index.php](https://www.npr.org/api/index.php). +There is some documentation in the NPR API site: [www.npr.org/api/index.php](https://www.npr.org/api/index.php). = Is there an easy way to directly query the NPR API? = -You bet, just visit the NPR Query Generator: [https://www.npr.org/api/queryGenerator.php](https://www.npr.org/api/queryGenerator.php) +You bet, just visit the NPR Query Generator: [www.npr.org/api/queryGenerator.php](https://www.npr.org/api/queryGenerator.php) == Screenshots == @@ -74,6 +73,17 @@ NPR Stories having got gotten == Changelog == += V1.7 = + +* The Story API box that appears in the post editor has been refreshed: + * Instead of requiring a separate action to push the story to the Story API, the content will be pushed whenever the content is saved in WordPress, if the "Send to NPR API" box is checked. + * The box now includes options to include the story for listening in NPR One, and to set the story as "featured" in NPR One. This feature includes the option to set an expiration date, after which time the story will not appear in NPR One. +* HTTPS is now supported for accessing the Story API. ([#44](https://github.com/npr/nprapi-wordpress/pull/44)) +* The push and pull post types are now respected, thanks to [#41](https://github.com/npr/nprapi-wordpress/pull/41) from [@chrisenterey](https://github.com/chrisentery). +* PHP 7 is now supported, thanks to [#42](https://github.com/npr/nprapi-wordpress/pull/42) from [@tjuddill](https://github.com/tjuddill). +* Several broken links in the documentation have been repaired. ([#44](https://github.com/npr/nprapi-wordpress/pull/44)) +* Automated tests are now run against an expanded list of WordPress and PHP versions, as described [in pull request #46](https://github.com/npr/nprapi-wordpress/pull/46). + = V1.6 = * Added meta box to post edit page to explicitly push a story to NPR One diff --git a/assets/js/meta-box.js b/assets/js/meta-box.js index 63ac279..387b818 100644 --- a/assets/js/meta-box.js +++ b/assets/js/meta-box.js @@ -1,5 +1,7 @@ /** * NPR Story API meta box functions and features + * + * @since 1.7 */ document.addEventListener('DOMContentLoaded', () => { 'use strict'; diff --git a/docs/assets/img/push-to-npr-api.png b/docs/assets/img/push-to-npr-api.png index bf20ba0..a094cb5 100644 Binary files a/docs/assets/img/push-to-npr-api.png and b/docs/assets/img/push-to-npr-api.png differ diff --git a/docs/assets/img/test-post-npr-one.png b/docs/assets/img/test-post-npr-one.png index 54c4057..22ab4e1 100644 Binary files a/docs/assets/img/test-post-npr-one.png and b/docs/assets/img/test-post-npr-one.png differ diff --git a/docs/npr-one.md b/docs/npr-one.md index 6b3329d..b52603b 100644 --- a/docs/npr-one.md +++ b/docs/npr-one.md @@ -2,10 +2,12 @@ You can easily push posts to the [NPR One mobile app](https://www.npr.org/about/products/npr-one/) in addition to the NPR API. -After you [set up the WordPress NPR API Plugin](settings.md) with your API Key and Org ID, you will see a new checkbox in the Post Edit screen for "Send to NPR One": +After you [set up the WordPress NPR API Plugin](settings.md) with your API Key and Org ID, you will see a new checkbox in the Post Edit screen for "Include for listening in NPR One": ![Send to NPR One checkbox in the WordPress post edit screen](assets/img/test-post-npr-one.png) The checkbox is not selected by default. This allows you to push all your stories to the NPR API, but only selected stories to NPR One. If you want to push a post to NPR One, check the box and hit the Publish or Update button. + +If you are sending the story to NPR One, you can also choose to mark the story as a featured story in NPR One. \ No newline at end of file diff --git a/docs/pushing.md b/docs/pushing.md index a11a064..87b038f 100644 --- a/docs/pushing.md +++ b/docs/pushing.md @@ -1,6 +1,6 @@ # Pushing Stories to the NPR API -You can push any of your posts to the NPR API by simply using the **Push to NPR** button in the post edit screen: +You can push any of your posts to the NPR API by checking the "Send to NPR API" box in the "NPR Story API" meta box in the post editor. Once this box is checked, publishing the post or saving an updated version of a published post will send the post to the NPR API. ![Push to NPR button in the post edit screen](assets/img/push-to-npr-api.png) @@ -24,7 +24,7 @@ If you don't see these custom fields in the post edit screen, click **Screen Opt ## Pushing Story Updates to the NPR API -If you edit a story that's previously been pushed to the NPR API, you can use the **Push to NPR** button in the post editor to update the post in the NPR API. +If you edit a story that's previously been pushed to the NPR API, the changes will be pushed to the NPR API. ## Deleting Posts from the NPR API diff --git a/ds-npr-api.php b/ds-npr-api.php index 80d2c0a..af26cd3 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 supplied by Digital Services. - * Version: 1.6 + * Version: 1.7 * Author: NPR Digital Services * License: GPLv2 */ diff --git a/meta-boxes.php b/meta-boxes.php index 6c45926..51e7e82 100644 --- a/meta-boxes.php +++ b/meta-boxes.php @@ -10,6 +10,8 @@ * @see nprstory_save_send_to_api * @see nprstory_save_send_to_one * @see nprstory_save_nprone_featured + * @see nprstory_publish_meta_box_assets + * @since 1.7 * * @todo When there is better browser support for input type="datetime-local", replace the jQuery UI and weird forms with the html5 solution. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local */ @@ -105,6 +107,9 @@ function nprstory_publish_meta_box( $post ) { /** * Register stylesheet for the NPR Story API publishing options metabox + * + * @since 1.7 + * @see nprstory_publish_meta_box */ function nprstory_publish_meta_box_assets() { wp_register_style( diff --git a/push_story.php b/push_story.php index 7d0299d..54e93a6 100644 --- a/push_story.php +++ b/push_story.php @@ -662,6 +662,7 @@ function nprstory_save_datetime( $post_ID ) { * @param WP_Post|int $post the post ID or WP_Post object * @return DateTime the DateTime object created from the post expiry date * @see note on DATE_ATOM and DATE_ISO8601 https://secure.php.net/manual/en/class.datetime.php#datetime.constants.types + * @since 1.7 * @todo rewrite this to use fewer queries, so it's using the WP_Post internally instead of the post ID */ function nprstory_get_post_expiry_datetime( $post ) {