Closed despecial closed 6 years ago
Must be a regression, I recall using this feature in the past successfully.
What happens if you add values to the attributes? Because it seems like the parsing function expects key-value arrays, instead of numerically indexed arrays, and when values are lacking, keys become values and numbers are used as keys.
This bug shouldn't be too hard to fix, feel free to give it a shot if you want to, I'll gladly merge it.
If not, we'll fix this before the new release comes out, which is when us maintainers have some time.
We can't use null
to remove values, because we need null
for attributes without value. unset
and so on.
Hey Christian, thanks for your feedback. I already looked into the code and added a new attribute for the shortcode.
[shortcode xhtml="data-abide novalidate"]
In the form output function, before the attributes loop, I extracted the value, removed it from the attributes array and echoed it to the form.
Working on this now. It appears that you could've also used data-abide=""
and novalidate=""
as a workaround.
https://github.com/libreform/wp-libre-form#adding-extra-attributes-to-the-form-element
But when I try to add this:
[libre-form id="39" data-abide novalidate xclass="hf_form"]
The output looks like this:
<form data-form-id="39" class="libre-form libre-form-39 hf_form" 0="data-abide" 1="novalidate">
Instead of the desired html:
<form data-abide novalidate class="hf_form">