-
Notifications
You must be signed in to change notification settings - Fork 32
Add support for background images within Elementor #1130
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
base: develop
Are you sure you want to change the base?
Conversation
The one coming from Elementor doesn't contain all the options from the settings and therefore isn't accurate enough
aatanasov-cloudinary
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gabriel-detassigny, I tested the PR on my side by adding a background image to a container element, and the local URL is used. The heading element works.
Back-end
Front-end
I confirm the replace_background_images_in_css hook was triggered on save (added a log to test it).
|
Thanks @aatanasov-cloudinary ! It turns out, the container elements used a slight different syntax for its keys (heading and such use Furthermore, the container applies an extra suffix internally which I couldn't retrieve directly via Elementor's internals, so I've applied it directly in that case. This fixes the issue now. I've also added some extra defensive code to check all Elementor methods interactions, as we can't be certain these methods will still exist in future versions. try {
// internal method calls.
}
catch ( \Throwable $e ) {
}however Anyway, have a look and let me know your thoughts! |
|
@gabriel-detassigny, thanks, when adding a background image to a container, I can see we have the following in the CSS:
Can you please check if we can optimize this as well (both selectors use background images delivered by Cloudinary)? Also, it will be helpful to look into the background overlay case. It uses Front-end
CMS
|



This ensures that background images generated within Elementor's CSS files are handled accordingly.
Approach
QA notes