Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#3775 closed enhancement (worksforme)

wp_die() does not have any formatting options which can break plugins that use AJAX.

Reported by: ajd777's profile ajd777 Owned by:
Milestone: Priority: low
Severity: minor Version: 2.1
Component: General Keywords:
Focuses: Cc:


Wp_die() should have a filter on outputted text because currently it forces plugins to work around it or attempt to hackishly avoid it.

For example, if you try to submit a comment through AJAX using the built in functions, there are many instances where wp_die() can be called, and if wp_die() is called the returned text includes a new style sheet and header which breaks the display of the page. Currently the only way around this is to use Javascript to immediately check the returned data and then parse out any error message.j

I would love to see a way to set a temporary option just before functions are called to make it possible to disable the styled output, but a filter would be just as effective.

As an aside, it would be nice if the formatted error message used the theme's error page for most errors.

Change History (7)

#1 @ajd777
17 years ago

  • Priority changed from normal to low
  • Severity changed from normal to minor

#2 @ryan
17 years ago

Ideally, we should be returning WP_Error objects up the stack and allowing the caller to handle the error. Which wp_die()s are you encountering?

#3 @ajd777
17 years ago

While testing my plugin (which among other things submits comments with AJAX), I've hit all of the wp_die()s for comment validation and in wp_allow_comment() at one time or another.

#4 @Nazgul
17 years ago

  • Milestone changed from 2.1.1 to 2.2
  • Type changed from defect to enhancement

#5 @foolswisdom
17 years ago

  • Milestone changed from 2.2 to 2.4

#6 @lloydbudd
16 years ago

  • Milestone changed from 2.5 to 2.7

Please attach a test case.

#7 @pishmishy
16 years ago

  • Milestone 2.7 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Closing as worksforme due to lack of feedback. Please feel free to attach the test case in the future and reopen this ticket.

Note: See TracTickets for help on using tickets.