There are potentially several approaches.
The first is of course use the default field. Keep in mind that’s a starting point. The default link allows general text for a popup. This can include HTML markup as desired.
A step beyond that can be to create a Terms page within your site structure and indicate that the TOS field link should open that instead of the default. You can indicate the location of that page using the tos shortcode (see: https://rocketgeek.com/plugins/wp-members/docs/shortcodes/form/#tos).
You can alter the link entirely to open whatever is desired. There are a number of places in the form building process to filter that to be what you want.
* wpmem_tos_link_txt
– changes the text. This can include changing where the link tags go (as described in the documentation).
* wpmem_register_form_rows
– this allows you to change a number of aspects related to this (or any) field in the array of form fields (as outlined in the documentation). Most specifically in your case, you can use this to alter the input tag contained in the ‘field’ key of the array.
I thought there was a filter to change just the link itself directly, but in looking through the form builder, that doesn’t seem to be the case, so I’ll add one in the next release.
Those all describe working with the default field. You aren’t limited to using that – you can certainly implement your own custom field of whatever type necessary. You are correct that HTML is not (currently) allowed in the creation of a field (so the label cannot contain HTML, nor can a default value). Presently, that’s a security issue to prevent cross site scripting exploits (XSS) and such. It is planned to update this in the near future to allow specific HTML in the creation of form fields. I know that doesn’t address your current question/situation, but I mention it for future reference.
In the meantime, if customization of any sort is needed in a form field, whether that’s additional HTML or anything else, the best way to achieve that is using the wpmem_register_form_rows filter I mentioned above (documentation linked above). That allows you full control over what ultimately gets displayed. You can use that filter to apply a custom label and/or input tag as necessary.
-
This reply was modified 5 years, 8 months ago by Chad Butler. Reason: fixed links/code formatting