elementor/elementor

Add `get_render_attribute` to `element-base.php`

tristanleboss opened this issue · 1 comments

Because property _render_attributes is private, it's not easy to work with render attributes.
It can happens if you try to extend an existing widget you have no control on (from a third party plugin, for example) and whant to add some render attributes depending on the one the original widget function already added (by calling the parent in the extended widget).

Indeed, I want to create (not replace or alter the original one) a new widget using the logic from another one.

This function would take two arguments: $element and $key and would return $this->_render_attributes[ $element ][ $key ].

The get_render_attributes_string is not really useull because it gives an "HTML" string with all the render attributes and so, needs parsing to grab the actual data.