php - Show warning/error to user without using wp_die -
I'm currently developing a WordPress plugin to work for my plugin, I need some information on settings information is.
- Is there a way to throw a warning / error that the blog administrator can see his message on his dashboard?
- Is there any other way to show errors other than wp_die ()? Just in case of my plugins (or someone else's) screws and I want to inform that in a fashion well;)
I would recommend using the admin_notices operation to allow you to display warnings and errors and to direct your users to a page:
Add_action ('admin_notices', 'my_custom_warning'); Function my_custom_warning () {if (true == true) {echo '& lt; Div id = "my-custom-warning" class = "error fade" & gt; & Lt; P & gt; This is a test & lt; / P & gt; & Lt; / Div & gt; '; }}
This method ensures that your users can still use WordPress but they will tell them where they can get a potential problem. Html
Comments
Post a Comment