这段代码可以在管理页面,自定义一个错误信息,把他放在主题的functions.php中就可以实现该功能

这段代码能够在办理页面,自定义一个错误信息,把他放在主题的functions.php中就能够完成该功用

在办理页面自定义错误信息  err 使用技巧 自定义 错误信息 新闻资讯 第1张

1 add_action( 'admin_notices', 'custom_error_notice' );
2 function custom_error_notice(){
3 global $current_screen;
4 if ( $current_screen->parent_base == 'themes' )
5 echo '<div class="error"><p>Warning – If you modify template files this could cause problems with your website.</p></div>';
6 }

转载请说明出处
知优网 » 在办理页面自定义错误信息

发表评论

您需要后才能发表评论