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

Commit

Permalink
remove send_to_org checkbox, save function, API push function
Browse files Browse the repository at this point in the history
  • Loading branch information
benlk committed Apr 17, 2018
1 parent 4234bd6 commit 493ef78
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 52 deletions.
17 changes: 0 additions & 17 deletions classes/nprml.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,6 @@ function nprstory_post_to_nprml_story( $post ) {
);
}

/*
* Send to NPR dot org
*
* If the box is checked, the value here is '1'
* @see nprstory_save_send_to_org
* @todo: what's the parent ID?
*/
$nprapi = get_post_meta( $post->ID, '_send_to_org', true ); // 0 or 1
if ( ! empty( $nprapi ) && ( '1' === $nprapi || 1 === $nprapi ) ) {
/*
$story[] = array(
'tag' => 'parent',
'attr' => array( 'id' => '', 'type' => 'collection' ),
);
*/
}

/*
* Mini Teaser (not yet implemented)
* Slug (not yet implemented)
Expand Down
8 changes: 0 additions & 8 deletions meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*
* @param WP_Post $post the WordPress post object.
* @see nprstory_save_send_to_api
* @see nprstory_save_send_to_org
* @see nprstory_save_send_to_one
* @see nprstory_save_nprone_featured
*
Expand Down Expand Up @@ -46,13 +45,6 @@ function nprstory_publish_meta_box( $post ) {

echo '<ul>';

// send to npr dot org
printf(
'<li><label><input value="1" type="checkbox" name="send_to_org" id="send_to_org" %2$s/> %1$s</label></li>',
__( 'Include for reading on NPR.org', 'nprapi' ),
checked( get_post_meta( $post->ID, '_send_to_org', true ), '1', false )
);

// send to nprone
printf(
'<li><label><input value="1" type="checkbox" name="send_to_one" id="send_to_one" %2$s/> %1$s</label> %3$s </li>',
Expand Down
27 changes: 0 additions & 27 deletions push_story.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,33 +559,6 @@ function nprstory_save_send_to_api( $post_ID ) {
}
add_action( 'save_post', 'nprstory_save_send_to_api');

/**
* Save the "send to NPR.org" metadata
*
* If the send_to_api value is falsy, then this should not be saved as truthy
*
* @param Int $post_ID The post ID of the post we're saving
* @since 1.7
*/
function nprstory_save_send_to_org( $post_ID ) {
// safety checks
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return false;
if ( ! current_user_can( 'edit_page', $post_ID ) ) return false;
if ( empty( $post_ID ) ) return false;

global $post;

if ( get_post_type($post) != get_option('ds_npr_push_post_type') ) return false;
$value = (
isset( $_POST['send_to_org'] )
&& $_POST['send_to_org'] == 1
&& isset( $_POST['send_to_api'] )
&& $_POST['send_to_api'] == 1
) ? 1 : 0;
update_post_meta( $post_ID, '_send_to_org', $value );
}
add_action( 'save_post', 'nprstory_save_send_to_org');

/**
* Save the "Send to NPR One" metadata
*
Expand Down

0 comments on commit 493ef78

Please sign in to comment.