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

Commit

Permalink
make sure wp_read_image_metadata() is defined when running media_hand…
Browse files Browse the repository at this point in the history
…le_sideload() during wp_cron

For #59
  • Loading branch information
benlk committed Sep 26, 2018
1 parent a58353b commit 8a4040f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions classes/NPRAPIWordpress.php
Expand Up @@ -334,6 +334,7 @@ function update_posts_from_stories( $publish = TRUE, $qnum = false ) {
}

// do the validation and storage stuff
require_once( ABSPATH . 'wp-admin/includes/media.php'); // needed for media_handle_sideload during cron
$id = media_handle_sideload( $file_array, $post_id, $image->title->value );
// If error storing permanently, unlink
if ( is_wp_error($id) ) {
Expand Down

0 comments on commit 8a4040f

Please sign in to comment.