Skip to content

Commit

Permalink
Update NPRAPIWordpress.php
Browse files Browse the repository at this point in the history
  • Loading branch information
santalone authored Dec 5, 2023
1 parent 8ab8398 commit 0228c9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/NPRAPIWordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ function update_posts_from_stories( $publish = TRUE, $qnum = false ) {
'meta_value' => $story->id,
'post_type' => $pull_post_type,
'post_status' => 'any',
'no_found_rows' => true
'no_found_rows' => true
]);

// set the mod_date and pub_date to now so that for a new story we will fail the test below and do the update
$post_mod_date = strtotime( date( 'Y-m-d H:i:s' ) );
$post_pub_date = $post_mod_date;
$cats = [];
if ( $exists->found_posts ) {
// BS: no_found_rows doesnt return $exists->found_posts, so use $exists->posts.
if ( $exists->posts ) {
$existing = $exists->post;
$post_id = $existing->ID;
$existing_status = $exists->posts[0]->post_status;
Expand Down

0 comments on commit 0228c9f

Please sign in to comment.