我正在为 WordPress 编写一个插件。当我使用该函数register_activation_hook
时,我收到以下错误:
The plugin generated 28 characters of unexpected output during activation.
If you notice "headers already sent" messages,
problems with syndication feeds or other issues,
try deactivating or removing this plugin.
相关代码:
register_activation_hook(__FILE__, function(){
echo "<script>alert('ok')</script>";
});