Overriding wp_die from within theme? (6 posts)

  1. fritzthecat
    Posted 7 years ago #

    Apologies if this has been asked before, I couldn't find it in the forum.

    I am happily working on my theme, the problem I am having is catching wp_die in the comments submission page, wp-comments-post.php. If the user submits no data, the script calls wp_die, which has HTML hard coded in it (oh dear). I actually want the page to be styled like the rest of the site. I looked at http://codex.wordpress.org/Plugin_API/Hooks and could find no hooks to do so.

    Of course, I could just edit functions.php, but that would make upgrading a pain.

    Any suggestions? Thanks in advance.

  2. moshu
    Posted 7 years ago #

    You are not the first to ask... but I can't remember any solution for it. Sorry.

  3. fritzthecat
    Posted 7 years ago #

    Thanks for your reply.

    Damn - time for a feature request... [http://wordpress.org/extend/ideas/topic.php?id=725&page&replies=1]

  4. ma1
    Posted 7 years ago #

    I badly needed something similar for my brand new blog (I've got digest protection on wp-admin directory, which is linked by the hard-coded error template), so I put together this hack:


    Hope it helps until a real solution is developed.

    -- Giorgio

  5. jer2eydevil88
    Posted 7 years ago #

    Thanks Giorgio,

    I will try to keep in mind they are called themes here :-D

    -- Lane

  6. Masarki Kondo
    Posted 7 years ago #

    I looked for a good method.

    With next version 2.6, "wp_die" filter seems to be added.
    I found it when I searched "wp_die filter" in google.
    (I want "$admin_dir" as well as an argument, too if possible.)

Topic Closed

This topic has been closed to new replies.

About this Topic