Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #49 from INN/release-1.7
Browse files Browse the repository at this point in the history
Release 1.7
  • Loading branch information
benlk authored Apr 23, 2018
2 parents 932b10e + 7865442 commit 853a301
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 8 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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? =
Expand All @@ -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 ==

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions assets/js/meta-box.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* NPR Story API meta box functions and features
*
* @since 1.7
*/
document.addEventListener('DOMContentLoaded', () => {
'use strict';
Expand Down
Binary file modified docs/assets/img/push-to-npr-api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/img/test-post-npr-one.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/npr-one.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions docs/pushing.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion 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 supplied by Digital Services.
* Version: 1.6
* Version: 1.7
* Author: NPR Digital Services
* License: GPLv2
*/
Expand Down
5 changes: 5 additions & 0 deletions meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions push_story.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 853a301

Please sign in to comment.