johndigital / funkstagram

A simple Instagram image importer for Wordpress
GNU General Public License v2.0
1 stars 0 forks source link

Use post_status' => 'any' on existing_posts check #1

Open drewbaker opened 8 years ago

drewbaker commented 8 years ago

Noticed a bug with this today, but it's edge case. But it would be worth adding a 'post_status' => 'any' parameter to the following query, in the off chance someone sets a attachment/post to draft (which I did programmatically on Exposure).

https://github.com/jrobson153/funkstagram/blob/master/funkstagram-class.php#L266-L272

                    $args = array(
                        'posts_per_page'    => 1,
                        'meta_key'          => 'instagram_id',
                        'meta_value'        => $gram_post["id"],
                        'post_type'         => 'attachment'
                    );
                    $existing_posts = get_posts($args);