Opened 5 weeks ago
Closed 5 weeks ago
#63511 closed defect (bug) (fixed)
Adjust deprecation note in WP_Community_Events::format_event_data_time()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | 5.5.2 |
Component: | Administration | Keywords: | good-first-bug has-patch dev-feedback |
Focuses: | Cc: |
Description (last modified by )
There's a function call in WP_Community_Events::format_event_data_time()
:
_deprecated_function( __METHOD__, '5.5.2', 'This is no longer used by core, and only kept for backward compatibility.' );
However, _deprecated_function()
does not support a custom string like that, so what this actually displays is:
Deprecated: Function format_event_data_time is <strong>deprecated</strong> since version 5.5.2! Use This is no longer used by core, and only kept for backward compatibility. instead.
Since the DocBlock already mentions that the method is unused:
@deprecated 5.6.0 No longer used in core.
I think we can just remove the third argument so that the default deprecation message is used:
Deprecated: Function format_event_data_time is <strong>deprecated</strong> since version 5.5.2 with no alternative available.
That would also be consistent with the ::maybe_log_events_response() method in the same class.
Alternatively, _doing_it_wrong()
can be used instead, which does support a custom message.
Introduced in [49146].
Attachments (1)
Change History (7)
This ticket was mentioned in PR #8877 on WordPress/wordpress-develop by @dhruvik18.
5 weeks ago
#2
- Keywords has-patch added; needs-patch removed
#3
follow-up:
↓ 5
@
5 weeks ago
- Keywords needs-patch added; has-patch removed
If we use _doing_it_wrong(), wouldn't it be considered as having alternative?
#5
in reply to:
↑ 3
@
5 weeks ago
- Keywords dev-feedback added
Replying to rollybueno:
If we use _doing_it_wrong(), wouldn't it be considered as having alternative?
Replying to SergeyBiryukov:
Alternatively,
_doing_it_wrong()
can be used instead, which does support a custom message.
doing_it_wrong
doesn't fit here.
And the deprecation informational text is 100% redundant, as the deprecation message is self-explanatory. It can be cleared with 0 trouble.
This can be shipped.
In this PR Refactored the deprecated function call to use _doing_it_wrong() for better clarity and compatibility in
WP_Community_Events::format_event_data_time()
Trac ticket: https://core.trac.wordpress.org/ticket/63511