I am using a view to build a series of HTML elements that have data attributes. One of the data attributes is pulled from a field that may have quotes, so those quotes need to be converted to their HTML entity (") before they are put into the data attribute, because the data attribute must itself have quotes around it. For example, if the field (called "Summary") value is:
this is text with "quotes" around it
the final HTML should look like this:
data-summary="this is text with "quotes" around it"
In order to perform this conversion, I've created a shortcode, as follows:
However, when the page is rendered, the content template shortcode is not executed, i.e. the HTML has the literal content template shortcode in it (see image).
Note that your form converts HTML entities to the character, so my text might be a little hard to read. It should say (I've used "-; so it won't convert)
...so those quotes need to be converted to their HTML entity (" 😉
the final HTML should look like this:
data-summary="this is text with "-;quotes"-; around it"
Hello. Thank you for contacting the Toolset support.
Can you please share the problem URL where you added the content template and access details so I can check the issue further.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Instead of using the content template, you need to use the [sanitize_text] shortcode directly as given under. Please replace it whereever you want to apply.