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

Gutenberg compatibility #51

Closed tw2113 closed 3 years ago

binarygary commented 6 years ago

I did not test this super-thoroughly. I did verify that on saving the content containing the URL still passed the youtube regex and a featured image was added.

The only note I have is that the content we will be looking at could be quite a bit longer than the default 800 characters we look at initially.

tw2113 commented 6 years ago

Did the "which block" matter? or does it all come in as part of $post->post_content upon save, regardless of how many blocks got added to the page? May be a "Michael doesn't know how Gutenberg internally works and where it saves" case, for what it's worth.

Quick idea: filter callback that checks if Gutenberg is active, and returns a much higher character count to slice off if it is.

tw2113 commented 6 years ago

Let's do a bit more testing/confirmation with this one, but I feel we have majority of what we need.

tw2113 commented 3 years ago

Sort of undoing, because I'm now just defaulting to 4000 characters.

See 1548826