Php Wordpress-如何将HTML添加到错误消息中
php我有一个过滤器,用于限制custtom消息的最大上载文件大小。我想在那里添加链接,但html在这里不起作用。你能帮我个忙吗 这是我的密码Php Wordpress-如何将HTML添加到错误消息中,php,wordpress,wordpress-theming,custom-wordpress-pages,wordpress-rest-api,Php,Wordpress,Wordpress Theming,Custom Wordpress Pages,Wordpress Rest Api,php我有一个过滤器,用于限制custtom消息的最大上载文件大小。我想在那里添加链接,但html在这里不起作用。你能帮我个忙吗 这是我的密码 add_filter(“wp_handle_upload_prefilter”),函数($file){ $file\u size\u limit=1024; $current_size=$file[“size”]; $current\u size=$current\u size/1024; 如果($current\u size>$file\u size\
add_filter(“wp_handle_upload_prefilter”),函数($file){
$file\u size\u limit=1024;
$current_size=$file[“size”];
$current\u size=$current\u size/1024;
如果($current\u size>$file\u size\u limit){
$file[“error”]=sprintf(
__(“文件太大,请联系”);
}
返回$file;
});
我的问题是我得到的是纯文本而不是html
谢谢您的帮助。我想因为您使用的是sprintf,它会返回一个字符串,如果您想渲染它,请先删除“\”,然后尝试将其作为字符串传递