I am adding my shortcodes using custom HTML block in WordPress Gutenberg editor.
[tagged_heading heading_tag="h2" description="Lorem ipsum <span data-attribute='1'></span> sodales dui."]
After updating the page all works ok, but after reloading editor window all single quotes, in data-attribute
for example, changed to double quotes. How I can prevent that?
2
Answers
Found a fast-fix solution, which works for me. Single quotes will stay intact if they are placed on the first level and double quotes inside of the single quotes. So just swap them e.g.
[tagged_heading text='Lorem ipsum dolor sit amet <mark data-tooltip="tooltip"></mark> sodales dui.']
I would suggest changing your shortcode to handle something like this…
Your PHP code might look like: