We have to use HTML tags to highlight an author name in bold, but we also want to pass the title of the post to a form which generates a PDF Certificate including the title of the post. We don’t want the tags included in the output.
domain.com/form?course_title={Field title} currently outputs domain.com/form?course_title=Arthritis%20pain%20management%20with%20{b}Tamara%20Grubb{/b}
Is there any way to filter out HTML tags in L&L before passing the {Field title} to the URL?
As far as I know, the only sanitize option in L&L right now is the as yet undocumented <Format slug></Format> tag, which will strip out html tags, convert to lowercase and replace spaces with dashes:
Can you make that work for your application? Otherwise I think the closest you can get to your current output is by also using a replace and url_query format tag, but your capitalization will be lost:
Thank you so much. The second option worked perfectly. I am using an all-caps style on the PDF generation, so it doesn’t matter about the capitalisation.
Hi Craig! Since Julia last responded to this post, there’s been a new remove_html feature added to the Format tag that’s specifically designed to remove HTML tags instead of using the somewhat hacky Format url_query approach that was suggested earlier which is what’s converting things to Unicode. So I imagine if your goal is still just to remove HTML tags, you should be able to do that with something like this:
<Set course_title_param><Format slug><Format remove_html><Field title /></Format></Format></Set>
http://domain.com/form?course_title{Get course_title_param}
Sure thing! The Format remove_html feature was added to the docs when the feature was released last month in version 3.2.1. I wasn’t aware of that Format slug option that Julia mentioned until I read this thread so I’ve gone ahead and added it to the docs as well!
Shameless plug, but if you’re enjoying the features and support that we’re offering with this free plugin and want to help out our team, you might consider adding those stars to a review of the plugin on the WordPress plugin repo If you’ve already posted a review, thanks a bunch for helping to share the word about the plugin!