【发布时间】:2017-11-27 19:02:07
【问题描述】:
我有 wp_add_inline_style() 包含的以下 redux 动态 css。
// redux dynamic css
global $x_redux_option;
$x_blogpost_overlay_switch = $ x_redux_option [' x_blogpost_overlay_switch];
$x_redux_dynamic_css = '
.single_post:hover{
background: ". if ($x_blogpost_overlay_switch == true): echo $x_blogpost_overlay; endif; ." ;
-webkit-box-shadow: " . if($x_blogpost_overlay_switch == true): ." 0 1px 10px 0 rgba(251,252,252,0.8) " . endif; ." ;
-moz-box-shadow: " . if($x_blogpost_overlay_switch == true): . " 0 1px 10px 0 rgba(251,252,252,0.8) " . endif; . " ;
box-shadow: " . if($x_blogpost_overlay_switch == true): . " 0 1px 10px 0 rgba(251,252,252,0.8) " . endif; . " ;
}
';
wp_add_inline_style( 'x-main-style', $x_redux_dynamic_css );
Mentor Themeforest 插件显示以下错误:
所有动态数据都必须针对其呈现的上下文进行正确转义。在文件 inc/scripts-styles.php 的第 213 行:背景:“。如果 ($x_blogpost_overlay_switch == true): echo $x_blogpost_overlay; endif; 。” ;
我怎样才能逃避这个动态 ( $x_blogpost_overlay ) css 属性值?
提前致谢。
【问题讨论】: