我安装了新的WordPress(5.0.2),并在函数末尾添加了代码。php文件:
function testsc(){
return "It is working!";
}
function testsc2(){
return "It is working!";
}
add_shortcode(\'testshortcode\', testsc);
add_shortcode(\'testshortcode2\', \'testsc2\');
安装调试对象插件后,我可以看到添加了短代码:
Shortcode: testshortcode Function: testsc
Shortcode: testshortcode2 Function: testsc2
但当我在页面中放置testshortcode或testshortcode2时,它被视为文本。
我使用默认主题:216。