我有一个短代码[gf_popup pause="1000" location="bottom"]
位置属性一直返回为Uncaught ReferenceError: bottom is not defined
. 想知道为什么吗?以下是代码的主要部分:
function gfpu_shortcode($atts = [], $content = null, $tags = \'\')
{
// normalize attribute keys, lowercase
$atts = array_change_key_case((array)$atts, CASE_LOWER);
// override default attributes with user attributes
$gfpu_atts = shortcode_atts([
\'pause\' => 5000,
\'location\' => \'false\',
\'popTrigger\' => \'false\',
], $atts, $tag);
$timer = esc_html__($gfpu_atts[\'pause\'], \'gf_popup\');
$location = esc_html__($gfpu_atts[\'location\'], \'gf_popup\');
$popTrigger = esc_html__($gfpu_atts[\'popTrigger\'], \'gf_popup\');
}
add_shortcode(\'gf_popup\', \'gfpu_shortcode\');
有什么想法吗?