{"action":"created","comment":{"url":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/comments/181931743","pull_request_review_id":112642611,"id":181931743,"diff_hunk":"@@ -1,20 +1,139 @@\n <?php\n+/**\n+ * File containing meta box callback functions\n+ */\n \n-function nprstory_publish_meta_box($post) {\n-\t$helper_text = 'Push this story to NPR:';\n-\t$is_disabled = ($post->post_status != 'publish');\n-\tif ($is_disabled) {\n-\t\t$helper_text = 'Publish this story in order to push it to NPR.';\n+/**\n+ * Output the NPR Story API publishing options metabox for the edit page admin interface\n+ *\n+ * @param WP_Post $post the WordPress post object.\n+ * @see nprstory_save_send_to_api\n+ * @see nprstory_save_send_to_org\n+ * @see nprstory_save_send_to_one\n+ * @see nprstory_save_nprone_featured\n+ *\n+ * @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\n+ */\n+function nprstory_publish_meta_box( $post ) {\n+\t$helper_text = __( 'Push this story to NPR:', 'nprapi' );\n+\t$is_disabled = ( 'publish' !== $post->post_status );\n+\t$attrs = array( 'id' => 'ds-npr-update-push' );\n+\n+\tif ( $is_disabled ) {\n+\t\t$helper_text = __( 'Publish this story in order to push it to NPR.', 'nprapi' );\n \t}\n-\t$attrs = array('id' => 'ds-npr-update-push');\n-\tif ($is_disabled)\n+\n+\tif (  $is_disabled ) {\n \t\t$attrs['disabled'] = 'disabled';\n-?>\n+\t}\n+\n+\twp_enqueue_style( 'jquery-ui' );\n+\twp_enqueue_style( 'nprstory_publish_meta_box_stylesheet' );\n+\twp_enqueue_script( 'nprstory_publish_meta_box_script' );\n+\n+\t?>\n \t<div id=\"ds-npr-publish-actions\">\n-\t\t<p class=\"helper-text\"><?php echo $helper_text; ?></p>\n-<?php\n-\tsubmit_button( 'Push to NPR', 'large', 'ds_npr_update_push', false, $attrs );\n-?>\n+\t\t<ul>\n+\t\t<?php\n+\t\t\t// send to the npr api\n+\t\t\t// The meta name here is '_send_to_nprone' for backwards compatibility with plugin versions 1.6 and prior\n+\t\t\t$nprapi = get_post_meta( $post->ID, '_send_to_nprone', true ); // 0 or 1\n+\t\t\tif ( '0' !== $nprapi && '1' !== $nprapi ) { $nprapi = 1; } // defaults to checked; unset on new posts\n+\n+\t\t\t// this list item contains all other list items, because their enabled/disabled depends on this checkbox\n+\t\t\techo '<li>';\n+\t\t\tprintf(\n+\t\t\t\t'<label><input value=\"1\" type=\"checkbox\" name=\"send_to_api\" id=\"send_to_api\" %2$s/> %1$s</label>',\n+\t\t\t\t__( 'Send to NPR API', 'nprapi' ),\n+\t\t\t\tchecked( $nprapi, '1', false )","path":"meta-boxes.php","position":55,"original_position":60,"commit_id":"22af682f419956747b3bdd636ef8a640d68174c7","original_commit_id":"8ce7dc441a5779f703b8ddebae539121ab673618","user":{"login":"jgarlow","id":188355,"avatar_url":"https://avatars2.githubusercontent.com/u/188355?v=4","gravatar_id":"","url":"https://api.github.com/users/jgarlow","html_url":"https://github.com/jgarlow","followers_url":"https://api.github.com/users/jgarlow/followers","following_url":"https://api.github.com/users/jgarlow/following{/other_user}","gists_url":"https://api.github.com/users/jgarlow/gists{/gist_id}","starred_url":"https://api.github.com/users/jgarlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgarlow/subscriptions","organizations_url":"https://api.github.com/users/jgarlow/orgs","repos_url":"https://api.github.com/users/jgarlow/repos","events_url":"https://api.github.com/users/jgarlow/events{/privacy}","received_events_url":"https://api.github.com/users/jgarlow/received_events","type":"User","site_admin":false},"body":"Thank you for the explanation!","created_at":"2018-04-17T01:41:37Z","updated_at":"2018-04-17T01:41:37Z","html_url":"https://github.com/npr/nprapi-wordpress/pull/47#discussion_r181931743","pull_request_url":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/comments/181931743"},"html":{"href":"https://github.com/npr/nprapi-wordpress/pull/47#discussion_r181931743"},"pull_request":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47"}},"in_reply_to_id":181215116},"pull_request":{"url":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47","id":178070371,"html_url":"https://github.com/npr/nprapi-wordpress/pull/47","diff_url":"https://github.com/npr/nprapi-wordpress/pull/47.diff","patch_url":"https://github.com/npr/nprapi-wordpress/pull/47.patch","issue_url":"https://api.github.com/repos/npr/nprapi-wordpress/issues/47","number":47,"state":"open","locked":false,"title":"Revisions to the NPR API editor meta box","user":{"login":"benlk","id":1754187,"avatar_url":"https://avatars2.githubusercontent.com/u/1754187?v=4","gravatar_id":"","url":"https://api.github.com/users/benlk","html_url":"https://github.com/benlk","followers_url":"https://api.github.com/users/benlk/followers","following_url":"https://api.github.com/users/benlk/following{/other_user}","gists_url":"https://api.github.com/users/benlk/gists{/gist_id}","starred_url":"https://api.github.com/users/benlk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlk/subscriptions","organizations_url":"https://api.github.com/users/benlk/orgs","repos_url":"https://api.github.com/users/benlk/repos","events_url":"https://api.github.com/users/benlk/events{/privacy}","received_events_url":"https://api.github.com/users/benlk/received_events","type":"User","site_admin":false},"body":"## Changes\r\n\r\n- Removes the \"push to NPR One\" checkbox from the \"Publish\" meta box, and moves it to the \"NPR Story API\" meta box\r\n- Adds checkboxes for \"Include for reading on NPR.org\" and \"Include for listening in NPR One\" and \"Set as featured story in NPR One\" settings. These checkboxes include server-side and browser-side validation, such that the two \"Include...\" checkboxes are only checked if \"Send to NPR API\" is checked, and \"Set as featured story in NPR One\" is only checked if \"Include for listening in NPR One\" is checked.\r\n    - ~~**QUESTION**: What's the NPRML parent ID supposed to be for sending a story to NPR.org?~~\r\n    - including for NPR One sets a NPRML parent ID of 319418027\r\n    - setting as featured in NPR One sets a NPRML parent ID of 500549367\r\n- Adds a field to track the date after which the story should no longer be pushed on NPR One, which defaults to 7 days from the story's publish date.\r\n    - The expiry date is stored in the post meta in ISO 8601 format, but is presented to the article editor using an HTML5 date input (or, if the useragent does not support that, the jQuery-ui datepicker) and an HTML5 time input (which falls back to text input with a placeholder)\r\n    - The expiry date is attached to the NPRML as the tag `audioRunByDate` with dates formatted like so: 1 Oct 2017 01:00:00 -0400, 29 Feb 2020 23:59:00 -0500\r\n    - Because WordPress does not include styles for jQuery-ui objects, this plugin of necessity includes a version of the jQuery-ui stylesheet and its spritesheet. This shim can be removed when all browsers support [`input type=\"date\"` ](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date). \r\n- Adds some comments and formatting fixes, generally by converting spaces to tabs\r\n- Adds a [plugin text domain](https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/) named `nprapi`\r\n\r\n## Notes\r\n\r\nTests will fail in PHP 5.3 because Travis-ci.org doesn't ship 5.3 on their default test-running boxes anymore. For updates to the test-running process to cover PHP 7 and 7.1, see https://github.com/npr/nprapi-wordpress/pull/46\r\n\r\nHTTPS support changes are in https://github.com/npr/nprapi-wordpress/pull/44\r\n\r\nMinor PHP 7 compat fixes are in https://github.com/npr/nprapi-wordpress/pull/42\r\n\r\n## Questions:\r\n\r\n- [x] What's the NPRML parent ID supposed to be for sending a story to NPR.org?\r\n- [ ] What version number should all this new functionality be tagged with? 1.6 was the last release of this plugin; should the docblock comments for these functions say `@version 1.7`?\r\n- [ ] How does including jQuery-ui's stylesheet and images from https://jqueryui.com/themeroller/ affect the plugin's license? https://jqueryui.com/themeroller/ was used to generate those; the footer of that page references https://jquery.org/license/ which says that all projects referencing it are MIT licensed. The downloaded CSS is  MIT licensed according to its header comment.","created_at":"2018-03-28T15:07:15Z","updated_at":"2018-04-17T01:41:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a91361429aa26c46b0db439117c6a29c37d703fb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47/commits","review_comments_url":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47/comments","review_comment_url":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/comments{/number}","comments_url":"https://api.github.com/repos/npr/nprapi-wordpress/issues/47/comments","statuses_url":"https://api.github.com/repos/npr/nprapi-wordpress/statuses/22af682f419956747b3bdd636ef8a640d68174c7","head":{"label":"INN:9-expiration-date-picker","ref":"9-expiration-date-picker","sha":"22af682f419956747b3bdd636ef8a640d68174c7","user":{"login":"INN","id":1553533,"avatar_url":"https://avatars2.githubusercontent.com/u/1553533?v=4","gravatar_id":"","url":"https://api.github.com/users/INN","html_url":"https://github.com/INN","followers_url":"https://api.github.com/users/INN/followers","following_url":"https://api.github.com/users/INN/following{/other_user}","gists_url":"https://api.github.com/users/INN/gists{/gist_id}","starred_url":"https://api.github.com/users/INN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/INN/subscriptions","organizations_url":"https://api.github.com/users/INN/orgs","repos_url":"https://api.github.com/users/INN/repos","events_url":"https://api.github.com/users/INN/events{/privacy}","received_events_url":"https://api.github.com/users/INN/received_events","type":"Organization","site_admin":false},"repo":{"id":60124405,"name":"WP-DS-NPR-API","full_name":"INN/WP-DS-NPR-API","owner":{"login":"INN","id":1553533,"avatar_url":"https://avatars2.githubusercontent.com/u/1553533?v=4","gravatar_id":"","url":"https://api.github.com/users/INN","html_url":"https://github.com/INN","followers_url":"https://api.github.com/users/INN/followers","following_url":"https://api.github.com/users/INN/following{/other_user}","gists_url":"https://api.github.com/users/INN/gists{/gist_id}","starred_url":"https://api.github.com/users/INN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/INN/subscriptions","organizations_url":"https://api.github.com/users/INN/orgs","repos_url":"https://api.github.com/users/INN/repos","events_url":"https://api.github.com/users/INN/events{/privacy}","received_events_url":"https://api.github.com/users/INN/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/INN/WP-DS-NPR-API","description":null,"fork":true,"url":"https://api.github.com/repos/INN/WP-DS-NPR-API","forks_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/forks","keys_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/keys{/key_id}","collaborators_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/teams","hooks_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/hooks","issue_events_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/issues/events{/number}","events_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/events","assignees_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/assignees{/user}","branches_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/branches{/branch}","tags_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/tags","blobs_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/git/refs{/sha}","trees_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/git/trees{/sha}","statuses_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/statuses/{sha}","languages_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/languages","stargazers_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/stargazers","contributors_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/contributors","subscribers_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/subscribers","subscription_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/subscription","commits_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/commits{/sha}","git_commits_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/git/commits{/sha}","comments_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/comments{/number}","issue_comment_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/issues/comments{/number}","contents_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/contents/{+path}","compare_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/compare/{base}...{head}","merges_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/merges","archive_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/downloads","issues_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/issues{/number}","pulls_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/pulls{/number}","milestones_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/milestones{/number}","notifications_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/labels{/name}","releases_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/releases{/id}","deployments_url":"https://api.github.com/repos/INN/WP-DS-NPR-API/deployments","created_at":"2016-05-31T21:22:56Z","updated_at":"2018-04-16T19:08:18Z","pushed_at":"2018-04-17T00:11:29Z","git_url":"git://github.com/INN/WP-DS-NPR-API.git","ssh_url":"git@github.com:INN/WP-DS-NPR-API.git","clone_url":"https://github.com/INN/WP-DS-NPR-API.git","svn_url":"https://github.com/INN/WP-DS-NPR-API","homepage":null,"size":5520,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"npr:master","ref":"master","sha":"806b3eca9f4eddcf7b1350eba174219dacce21e6","user":{"login":"npr","id":332099,"avatar_url":"https://avatars1.githubusercontent.com/u/332099?v=4","gravatar_id":"","url":"https://api.github.com/users/npr","html_url":"https://github.com/npr","followers_url":"https://api.github.com/users/npr/followers","following_url":"https://api.github.com/users/npr/following{/other_user}","gists_url":"https://api.github.com/users/npr/gists{/gist_id}","starred_url":"https://api.github.com/users/npr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npr/subscriptions","organizations_url":"https://api.github.com/users/npr/orgs","repos_url":"https://api.github.com/users/npr/repos","events_url":"https://api.github.com/users/npr/events{/privacy}","received_events_url":"https://api.github.com/users/npr/received_events","type":"Organization","site_admin":false},"repo":{"id":4704477,"name":"nprapi-wordpress","full_name":"npr/nprapi-wordpress","owner":{"login":"npr","id":332099,"avatar_url":"https://avatars1.githubusercontent.com/u/332099?v=4","gravatar_id":"","url":"https://api.github.com/users/npr","html_url":"https://github.com/npr","followers_url":"https://api.github.com/users/npr/followers","following_url":"https://api.github.com/users/npr/following{/other_user}","gists_url":"https://api.github.com/users/npr/gists{/gist_id}","starred_url":"https://api.github.com/users/npr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npr/subscriptions","organizations_url":"https://api.github.com/users/npr/orgs","repos_url":"https://api.github.com/users/npr/repos","events_url":"https://api.github.com/users/npr/events{/privacy}","received_events_url":"https://api.github.com/users/npr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/npr/nprapi-wordpress","description":"Access the NPR API from within Wordpress","fork":false,"url":"https://api.github.com/repos/npr/nprapi-wordpress","forks_url":"https://api.github.com/repos/npr/nprapi-wordpress/forks","keys_url":"https://api.github.com/repos/npr/nprapi-wordpress/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npr/nprapi-wordpress/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npr/nprapi-wordpress/teams","hooks_url":"https://api.github.com/repos/npr/nprapi-wordpress/hooks","issue_events_url":"https://api.github.com/repos/npr/nprapi-wordpress/issues/events{/number}","events_url":"https://api.github.com/repos/npr/nprapi-wordpress/events","assignees_url":"https://api.github.com/repos/npr/nprapi-wordpress/assignees{/user}","branches_url":"https://api.github.com/repos/npr/nprapi-wordpress/branches{/branch}","tags_url":"https://api.github.com/repos/npr/nprapi-wordpress/tags","blobs_url":"https://api.github.com/repos/npr/nprapi-wordpress/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npr/nprapi-wordpress/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npr/nprapi-wordpress/git/refs{/sha}","trees_url":"https://api.github.com/repos/npr/nprapi-wordpress/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npr/nprapi-wordpress/statuses/{sha}","languages_url":"https://api.github.com/repos/npr/nprapi-wordpress/languages","stargazers_url":"https://api.github.com/repos/npr/nprapi-wordpress/stargazers","contributors_url":"https://api.github.com/repos/npr/nprapi-wordpress/contributors","subscribers_url":"https://api.github.com/repos/npr/nprapi-wordpress/subscribers","subscription_url":"https://api.github.com/repos/npr/nprapi-wordpress/subscription","commits_url":"https://api.github.com/repos/npr/nprapi-wordpress/commits{/sha}","git_commits_url":"https://api.github.com/repos/npr/nprapi-wordpress/git/commits{/sha}","comments_url":"https://api.github.com/repos/npr/nprapi-wordpress/comments{/number}","issue_comment_url":"https://api.github.com/repos/npr/nprapi-wordpress/issues/comments{/number}","contents_url":"https://api.github.com/repos/npr/nprapi-wordpress/contents/{+path}","compare_url":"https://api.github.com/repos/npr/nprapi-wordpress/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npr/nprapi-wordpress/merges","archive_url":"https://api.github.com/repos/npr/nprapi-wordpress/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npr/nprapi-wordpress/downloads","issues_url":"https://api.github.com/repos/npr/nprapi-wordpress/issues{/number}","pulls_url":"https://api.github.com/repos/npr/nprapi-wordpress/pulls{/number}","milestones_url":"https://api.github.com/repos/npr/nprapi-wordpress/milestones{/number}","notifications_url":"https://api.github.com/repos/npr/nprapi-wordpress/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npr/nprapi-wordpress/labels{/name}","releases_url":"https://api.github.com/repos/npr/nprapi-wordpress/releases{/id}","deployments_url":"https://api.github.com/repos/npr/nprapi-wordpress/deployments","created_at":"2012-06-18T18:19:45Z","updated_at":"2018-04-17T00:10:52Z","pushed_at":"2018-04-17T00:11:30Z","git_url":"git://github.com/npr/nprapi-wordpress.git","ssh_url":"git@github.com:npr/nprapi-wordpress.git","clone_url":"https://github.com/npr/nprapi-wordpress.git","svn_url":"https://github.com/npr/nprapi-wordpress","homepage":"","size":8414,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":20,"open_issues":26,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47"},"html":{"href":"https://github.com/npr/nprapi-wordpress/pull/47"},"issue":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/issues/47"},"comments":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/npr/nprapi-wordpress/statuses/22af682f419956747b3bdd636ef8a640d68174c7"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jgarlow"}}