-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin pulls thumb back down right after removing featured image in WP #65
Comments
Closest i can find for a potential solution, with the current code base in version 1.1.1, would be the The question is how to do this conditionally for your cases. Even something simple like I'm open to ideas on how to handle such a thing, so that we can help provide a solution into the code that is agnostic enough to make sense, but still help your specific usecase. |
What about using something like this?
Then we change lines 151-165 to check if the new field value is true, else we fail as if there was no video content...
Mind you I cobbled this together from about a 1/2 dozen sources and the codex but I think it would work, have not tested yet. If you have any input I'd appreciate it before I try to add this into a local test... |
I'm also unclear as to if we need to verify the user via nonce before we save the data out as a security precaution... |
At least in what I can think of right now, it'd probably end up being more of a case of doing a filter early in our save_post callback that checks a variable's boolean status. Skeleton code below.
This way we default to false meaning we shouldn't bypass setting, but we allow someone else to intercept that value and return true if we should. The only caveat of sorts is that we still end up requiring the user to determine if it should skip, and how to do and determine that will depend on each usecase. Could be as simple as storing an array of IDs that shouldn't thumbnails as an option and doing an |
I agree, the second option (which is I think what the top part of the code I posted does) adds a checkbox that defaults to true. |
Gotcha, I missed seeing that checkbox part as I wasn't quite sure at the time about that filter. I know we have output somewhere for some values, i just can't immediately recall how they are, other than just in the out-of-box custom fields metabox. The plugin is coded in a way where we don't download/re-upload the same file many times, because that makes a huge mess of media libraries. What we do is we name the images uniquely by the video ID, and before we do any down/uploading, we check the posts table for matching media library items by the same ID and make those the featured image, if found. Long term, what we'd be essentially doing is just not re-assigning the thumbnail meta data if we're told to skip. If at all possible, not doing it in the first place if somehow told not to. Details we'd need to work out. |
Overall, this has been rock solid since I fixed that Gutenberg problem from another thread.
Issue popped up today and I can't see an easy way to deal with this. Client wants to have a post or category of posts not have featured images, but still have a link to a youtube video in the post. All efforts so far show us deleting the image and then a second later, it re-populates the featured image file...
Only solution I have to date is to use bitl.ly shortened links and that removes the URL format the plugin is looking for.
Any way to turn this off per post?
The text was updated successfully, but these errors were encountered: