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.

  1. Is there a way to throw a warning / error that the blog administrator can see his message on his dashboard?
  2. 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

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -