WordPress.org

Forums

Overriding wp_die from within theme? (6 posts)

  1. fritzthecat
    Member
    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
    Member
    Posted 7 years ago #

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

  3. fritzthecat
    Member
    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
    Member
    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:

    http://hackademix.net/blog/2007/07/31/themed-error-pages/

    Hope it helps until a real solution is developed.

    Cheers
    -- Giorgio

  5. jer2eydevil88
    Member
    Posted 7 years ago #

    Thanks Giorgio,

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

    -- Lane

  6. Masarki Kondo
    Member
    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.
    http://trac.wordpress.org/ticket/6589
    (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