WordPress to changing simple quotes for double quotes
CONTEXT. I work with WordPress 4.7.5 and shortcodes.
GOAL. Put a link that displays information hidden as an accordion. The simple way to do this is to insert a shortcode Accordion type:
[su_accordion]
[su_spoiler title="My link"]
<h1>Lorem ipsum dolor sit amet</h1>
[/su_spoiler]
[/su_accordion]
This works perfectly. But my goal is slightly more complex: the link (My link) must be embedded within an HTML tag, for example a table:
[su_accordion]
[su_spoiler title="
<table class='my-custom-class-1'>
<tbody>
<tr>
<td class='my-custom-class-2'>My link</td>
</tr>
</tbody>
</table>
"]
<h1>Lorem ipsum dolor sit amet</h1>
[/su_spoiler]
[/su_accordion]
As you can see, my-custom-class-1 and my-custom-class-2 are in single quotes. They can not are in double quotes because WordPress would be confused with the double quotation marks of the accordion.
Now, this also works perfectly.
PROBLEM. The problem comes when, some time later, I want to edit this item. WordPress automatically modifies the shortcode, changing my single quotes by double quotation marks, which evidently breaks the shortcode, so that the link is no longer visible in the frontend.
How to prevent WordPress from changing the quotes? Or any other ideas on how to fix this?
I answer my own question.
I found this plugin that does the following: any HTML located between the [raw] and [/raw] tags will not be modified by anything or anyone: https://wordpress.org/plugins/raw-html/
链接地址: http://www.djcxy.com/p/69562.html下一篇: WordPress更改双引号的简单引号