• Hello, I’m working on a plugin for WP. I want to turn on error/success messages in WordPress. Such as warning when no username/password was filled in the form for creating new user. Or message saying success after creating a new category or tag. I found out these messages are somehow triggered – turned on, when I load some JavaScript with some sort of error. Such as when I use “document.getElementsById(“createuser”);” – it should be ElementById, not ElementsById…

    Well my question is what is the propper way of turning on these messages? I dont want to turn them on by loading javascript causing some sort of error to turn on these messages.

    Thank you very much for your help.
    Petroit

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is curious since javascript runs in your client browser, while you are also talking about server side processes like creating a category tag.

    The conventional way of turning on WordPress server side errors is by editing your “wp-config.php” file and setting:
    define('WP_DEBUG', true);
    There is possibly also some settings in the php envirnoment.

    For all browser issues (and hence javascript errors), I use firebug (for firefox), other browsers have their equivalent addon.
    The firebug console reports javascript issues, lots of monitoring options.

    Thread Starter Petroit

    (@petroit)

    Yeah, but turning on serve side errors is not what I mean. I have in mind that kind of messages like ‘User Peter was successfully created’ or ‘Your email address is invalid’ and so on. Messages programmed by WordPress already and displayed in most occasions. But some of them do not show until I do that javascript hack…if it can be even called hack.

    I just want WP admin to show the message ‘ERROR: Please enter username/password/email’ when attempting to create new user. Not just mark empty fields with red.

    I guess I have to show you a printscreen, so it is obvious what I mean…

    Classic WP behavior:
    Image 1

    Desired behavior – when using any javascript with wrong syntax
    Image 2

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Enabling Error Messages’ is closed to new replies.