Comments (6)
I completely agree with that.
I was about to open an issue to ask to have the fallback image loaded last, as this line reverses the array and it gets output first, which seems to result in it getting chosen more often than the other images.
I would suggest two changes:
- Don't load the fallback image if there's a featured image
- Output the fallback image at the end of the list of images, if there isn't a featured image.
Happy to submit a PR if it would help.
from wpfbogp.
@jjeaton make sure you're looking at the develop
branch. That's where all the new stuff is. Beta 2 is the official last tag but I've got a lot of stuff in there since. So.. look there.
That array is currently fixed but re: this topic... thinking about taking the fallback out if a featured is found.
This also means I need to fix the featured issue I found and listed in #53
Technically it all works and nobody's ever complained but I could try and push that into this next main release or do it as a .1 after the fact. I'd really like to get this puppy out this weekend if I can. 👍
from wpfbogp.
Okay bear with me here. Sketched this out on my mirror (whiteboard alternative ;) Need to talk it through and add in proper wp code after.
NEW FLOW
IF forcefallbackimage checkbox is TRUE && fallback image is not empty {
-- echo meta og:image with fallback image url.
done.
ELSEIF is a post, page, or page_for_posts (blog run by a page in settings) && thumbnails are enabled && it has a thumbnail
-- echo meta og:image with featured image url.
done.
ELSEIF {
IF is post, page, or frontpage with page_on_front {
-- run through the content and add to array
} IF fallback image is not empty {
-- add fallback image to bottom of array
}
test array and output the image array to meta og:image tag(s).
else after all that shit - nothing is there then output <!-- no images found bro --> warning.
}
WHEW.....
sound good?? cc @jjeaton
I need a beer
from wpfbogp.
first stab at this rewrite. more to go. in branch feature/images-overhaul
line 160.
25f8fa1#diff-c8cc0644f3623183b121b88dde0bae39R259
from wpfbogp.
Your logic here looks sound to me.
from wpfbogp.
2.3.0-beta.3 has it all inclusive. feel free to test: https://github.com/chuckreynolds/WPFBOGP/releases/tag/2.3.0-beta.3
from wpfbogp.
Related Issues (20)
- setup unit tests and travis stuff someday
- adding debugging support helpers to source output HOT 1
- look into force_fallback loop and get featimg working on pages that are the blog HOT 1
- After upgrading to 2.0.12 it is adding trailing slash to url HOT 2
- trailing slashes being added onto urls with forced file names HOT 1
- update admin pages html after 4.3
- look at moving prefix to <head> instead of <html> per new doc recommendation
- quicknote: check title attrib vs the title HOT 1
- remove requirement for fb:admins and/or fb:app_id per latest spec
- should make description a little smarter
- test urls with params
- Admin screen heading tags with WordPress 4.4 HOT 1
- description feature request fix
- preg_replace() /e modifier is now deprecated. Instead, use the preg_replace_callback() function HOT 2
- Protocol-less image URLs aren't handled properly HOT 1
- Better sanitize ALL input fields
- Annoying advice in WPMU HOT 1
- setup notice on all pages: reconsider all pages, also make dissmissable
- Featured image chosen from gallery is not picked up as OpenGraph image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpfbogp.