Ticket #3775 (closed enhancement: worksforme)

Opened 2 years ago

Last modified 5 months ago

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

Reported by: ajd777 Assigned to: anonymous
Priority: low Milestone:
Component: General Version: 2.1
Severity: minor Keywords:
Cc:

Description

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

02/12/07 04:35:03 changed by ajd777

  • priority changed from normal to low.
  • severity changed from normal to minor.

02/12/07 07:57:22 changed by ryan

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?

02/12/07 18:04:36 changed by ajd777

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.

02/21/07 15:57:06 changed by Nazgul

  • type changed from defect to enhancement.
  • milestone changed from 2.1.1 to 2.2.

03/27/07 02:26:16 changed by foolswisdom

  • milestone changed from 2.2 to 2.4.

03/12/08 03:15:47 changed by lloydbudd

  • milestone changed from 2.5 to 2.7.

Please attach a test case.

06/26/08 10:08:24 changed by pishmishy

  • status changed from new to closed.
  • resolution set to worksforme.
  • milestone deleted.

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