@galbaras – thanks for your thought-provoking contribution to this topic.
The mla_link_attributes
parameter allows any attribute(s) to be added to the link and treats all attributes the same. For security reasons, all HTML?Event Attributes are deleted and everything else is run through esc_attr()
. These restrictions were put in place to resolve a reported security issue from Wordfence.
The data-src
attribute is one example of an HTML?data-*?Attribute, These are used to “used to store custom data private to the page or application” and the attribute value “can be any string”. I realize that data-src
in particular is widely used, but I am reluctant to start looking for specific attributes and treating them differently.
The security issue is confined to shortcode attributes because any user with Contributor role or higher can put shortcodes in post/page content. Custom markup templates are created in the plugin settings admin area and are restricted to Administrator roles. That seems like a reasonable compromise.