soflyy / breakdance-bugs

Bug reports from Breakdance users.
38 stars 6 forks source link

breakdance_element_classnames_for_html_class_attribute nclasses not added inside page builder #1056

Open marius-robotdance opened 3 months ago

marius-robotdance commented 3 months ago

If the filter "breakdance_element_classnames_for_html_class_attribute" is used, the classes are rendered in the frontend, but not in the builder.

add_filter("breakdance_element_classnames_for_html_class_attribute", function ($classNames) { $classNames[] = 'another-class'; return $classNames; });

The class 'another-class' is not added to the element in the builder. In the frontend it seems to be ok. Also if you use different priorities (1-10, PHP_INT_MAX) it doesn't work. Also by setting the attribute for the parameter count it doesn't work.

I have also checked the filter 'breakdance_render_element_class_list'. Same problem here.

Or do I something wrong?

And... can you clarify, whats the difference between these two hooks?

marius-robotdance commented 3 months ago

The _render function seems to be ok (checked via log file). The class is added to the $acc variable. So the bug seems to be after the _render function.

Are the classes stripped via js?

marius-robotdance commented 2 months ago

Any news here?