Skip to content

Add get_render_attribute to element-base.php #5878

Closed
@tristanleboss

Description

@tristanleboss

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions