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
Clear Used CSS when Divi saves template item #5837
Comments
Reproduce the problem ✅The problem was easy to reproduce. Identify the root cause ✅Like @DahmaniAdame we are not clearing the used css when a template item changes. Scope a solution ✅We will create a new method in the divi compatibility class which will take we will bail out if non of the custom post types match any of this
Add tests too Estimate the effort ✅[S] |
@engahmeds3ed Not sure if you're still working on it, if not, could you unassign and move it back to |
I'm working on it |
After a discussion with @jeawhanlee we agreed on the following: As @DahmaniAdame mentioned in the issue, When saving the template, the action My concern here is that may be a resource consuming enhancement on the customer's side and our SaaS side for large sites so I was thinking of two approaches:
Any suggestions? or you see that over complicate it? |
@engahmeds3ed why not do both? |
Good one, Yes we can do that and I believe that would work. |
there is a missing part here, which is: the post ids mentioned in the last step before clearing used CSS are not real post ids they are the divi layouts' ids so with those ids we need to get their post meta with the key and there are many variations in divi like here: Thanks @DahmaniAdame for confirming that, seems like we have few approaches here that we need to take a decision about:-
The second approach will take more effort that the first one but it will make the process of saving templates more heavy and more CPU usage. What do u think @wp-media/php I'm out of ideas |
@DahmaniAdame What do you think about 3rd approach? It would be similar to what we'll be doing with Elementor, and applying that kind of pattern for different themes/builders would make a good UX while keeping the code easy to maintain. We need to keep in mind that any breaking changes in the 3rd-party code might need reopening this issue if we go with |
@piotrbak @engahmeds3ed |
Okay, so, the Acceptance Criteria here will be:
|
@piotrbak I have two questions here:
|
Thanks @engahmeds3ed good point about the used css in the database. Let's go with proposed solution if used CSS is disabled. For the notice, yes, I meant introducing a button, sorry for not being clear enough |
Before submitting an issue please check that you’ve completed the following steps:
3.12.6.1
Describe the bug
Divi has a template builder feature where the header, body, and footer can be set globally or under specific conditions.
If one of them is changed, we are not triggering the Used CSS clearing. This results in whatever was changed to have their style missing.
Divi stores them on specific post types:
All posts linked to a specific header, body, or footer will be documented on a customer field called, respectively,
_et_header_layout_id
,_et_body_layout_id
,_et_footer_layout_id
.We can track
et_save_post
, check if one of the specific post types is being saved, and then fire the following for any post with the corresponding custom field to have its Used CSS cleared, which should also clear the cache.et_save_post
takes the$post_id
as a parameter.The custom field to target can be built using:
With an SQL command that uses that specific custom field to get the matching posts to be processed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We should clear the Used CSS when items from Divi's Theme Builder change.
Screenshots
N/A
Additional context
Ticket - https://secure.helpscout.net/conversation/2184716932/408393/
Backlog Grooming (for WP Media dev team use only)
The text was updated successfully, but these errors were encountered: