WebDevStudios / Automatic-Featured-Images-from-Videos

If a YouTube or Vimeo video exists in the first few paragraphs of a post, automatically set the post's featured image to that vidoe's thumbnail.
33 stars 24 forks source link

Use of get_the_ID() when $post_id is passed in #4

Closed tw2113 closed 8 years ago

tw2113 commented 9 years ago

Nitpicky extra function call but we do get the specific post ID passed into the callback that we can use instead of get_the_ID().

bradp commented 9 years ago

We changed this in 3a7ff90f711a891640dca38541821a28c7a69fb8, as we found it to be more consistent, because otherwise we seemed to get revision IDs or something sometime.

Brad Parbs

On Jan 29, 2015, at 7:34 PM, Michael Beckwith notifications@github.com wrote:

Nitpicky extra function call but we do get the specific post ID passed into the callback that we can use instead of get_the_ID().

— Reply to this email directly or view it on GitHub.

tw2113 commented 9 years ago

Ah.

if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
    return;
}

should solve that issue, for future consideration. The save_posttype hook would have those two firing regularly.

bradp commented 9 years ago

PR it up!

Brad Parbs

On Jan 29, 2015, at 7:46 PM, Michael Beckwith notifications@github.com wrote:

Ah.

if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } should solve that issue, for future consideration. The save_posttype hook would have those two firing regularly.

— Reply to this email directly or view it on GitHub.

jtsternberg commented 9 years ago

:+1:

tw2113 commented 8 years ago

This got fixed at some point.