WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 6 weeks ago

#48483 closed defect (bug) (fixed)

Remove <pre> tags from _deprecated_constructor()

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: normal Version:
Component: General Keywords: good-first-bug has-patch
Focuses: coding-standards Cc:
PR Number:

Description

The _deprecated_constructor() function introduced in [32989] wraps the replacement name in <pre> tags, which breaks the message into multiple lines and looks weird. It's also inconsistent with other _deprecated_*() functions, which don't wrap the replacement name in any tags:

  • _deprecated_function()
  • _deprecated_file()
  • _deprecated_argument()
  • _deprecated_hook()

If anything, <code> should be used here instead of <pre> to keep the message on a single line.

Example of a current message:

Deprecated: The called constructor method for WP_Widget in WP_Widget is deprecated since version 4.3.0! Use

__construct()

instead. in wp-includes/functions.php on line 4711

The expected result:

Deprecated: The called constructor method for WP_Widget in WP_Widget is deprecated since version 4.3.0! Use __construct() instead. in wp-includes/functions.php on line 4711

Attachments (1)

48483.diff (1.1 KB) - added by aftabmuni 6 weeks ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
6 weeks ago

  • Keywords needs-patch good-first-bug added

@aftabmuni
6 weeks ago

#2 @aftabmuni
6 weeks ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
6 weeks ago

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

In 46633:

General: Wrap the error message in _deprecated_constructor() in <code> tags instead of <pre>.

Props aftabmuni.
Fixes #48483.

Note: See TracTickets for help on using tickets.