【发布时间】:2022-01-19 21:12:20
【问题描述】:
我正在使用“地理定位 IP 检测”插件,以便为访问者提供本地化的亚马逊联盟链接。
当我在自定义 HTML 块中输入类似内容时:
[geoip_detect2_show_if country="MX"]
<div class="wp-block-buttons is-content-justification-center">
<!--wp:button {"backgroundColor":"luminous-vivid-
orange","textColor":"white","className":"is-style-fill"} -->
<div class="wp-block-button is-style-fill">
<a class="wp-block-button__link has-white-color has-luminous-
vivid-orange-background-color has-text-color has-background" href="https://amzn.to/example" target="_blank" rel="noreferrer noopener nofollow">See on Amazon</a>
</div>
<!-- /wp:button -->
</div>
[/geoip_detect2_show_if]
当我回到编辑器时,我在自定义 HTML 块中得到了这个:
[geoip_detect2_show_if country="MX"]
<div class="wp-block-buttons is-content-justification-center"></div>
[/geoip_detect2_show_if]
链接在编辑器中被删除。这些块似乎工作正常(提供本地化链接),但如果我再次保存页面,没有链接的代码会更新到页面中。
【问题讨论】:
标签: wordpress custom-wordpress-pages wordpress-shortcode