Make WordPress Core

#59455 closed task (blessed) (fixed)

Replace trigger_error() with wp_trigger_error() for 6.4

Reported by: hellofromtonya's profile hellofromTonya Owned by:
Milestone: 6.4 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

This ticket tracks an initiative to replace each instance of trigger_error() with wp_trigger_error(). The initiative seeks to avoid generating E_USER family errors unless WP_DEBUG is on. In doing so, users should not see these messages in normal production.

References:

Change History (4)

#2 @hellofromTonya
17 months ago

I made this ticket a blessed task in the spirit of other similar initiatives in each release, such as #58833, #58976, #58955, etc.

#3 @hellofromTonya
17 months ago

In 56544:

Code Modernization: Use wp_trigger_error() in WP_Text_Diff_Renderer_Table magic methods.

Replaces trigger_error() with wp_trigger_error() in each of the WP_Text_Diff_Renderer_Table magic methods.

[56354] added the dynamic properties deprecation messages to the __get(), __set(), __isset(), __unset() magic methods. Since that commit, wp_trigger_error() was introduced (see [56530]) as a wrapper for trigger_error().

Follow-up to [56354], [56530].

See #58898, #57686.

#4 @hellofromTonya
17 months ago

In 56705:

General: Use wp_trigger_error() in _doing_it_wrong() and _deprecated_*().

Uses wp_trigger_error() in _doing_it_wrong() and each _deprecated_*() function, i.e. instead of trigger_error().

To avoid redundancy, uses wp_trigger_error() once. How? Saves each message to $message variable and then passes it to wp_trigger_error() at the end of the function.

Functions:

  • _doing_it_wrong()
  • _deprecated_function()
  • _deprecated_constructor()
  • _deprecated_class()
  • _deprecated_file()
  • _deprecated_argument()
  • _deprecated_hook()

Follow-up to [56530].

Props azaozz, costdev, flixos90, hellofromTonya, peterwilsoncc.
See #57686.

#5 @hellofromTonya
16 months ago

  • Resolution set to fixed
  • Status changed from new to closed

#59652 is now open for 6.5. With 6.4 RC1 happening in a couple of hours, closing this ticket.

Note: See TracTickets for help on using tickets.