Skip to content

Commit 50badb2

Browse files
author
Antti Kuosmanen
committed
Add section about custom attributes
1 parent 6ebcf05 commit 50badb2

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

readme.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,28 @@ add_filter( 'wplf_load_polylang' , function() {
176176
} );
177177
```
178178

179-
## Adding classes to the rendered form element
179+
## Adding extra classes to the form element
180180

181181
You can use the xclass attribute inside the shortcode to add your own extra classes for CSS.
182182

183183
```
184184
[libre-form id="1" xclass="extra"]
185185
```
186186

187+
## Adding extra attributes to the form element
188+
189+
You can add any custom attributes to the form element easily by adding them to the shortcode
190+
191+
```
192+
[libre-form id="1" data-custom-attr="contactme"]
193+
```
194+
195+
The attribute will render as is on the `<form>` element
196+
197+
```html
198+
<form class="libre-form libre-form-1" data-custom-attr="contactme">
199+
```
200+
187201
## Contributing
188202

189203
Please make sure your code conforms to the code style used in the rest of the plugin.

0 commit comments

Comments
 (0)