Opened 9 hours ago
Last modified 55 minutes ago
#65475 new defect (bug)
Fonts API: Replace _doing_it_wrong() with wp_trigger_error() in WP_Font_Face
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | minor | Version: | 6.4 |
| Component: | General | Keywords: | has-patch |
| Focuses: | coding-standards | Cc: |
Description
In WP_Font_Face::validate_font_face_declarations(), _doing_it_wrong() is currently used to trigger notices when invalid font face properties are encountered (e.g., invalid font-family, src, or font-weight).
Above each of these four occurrences is an inline comment:
// @todo replace with wp_trigger_error().
Since wp_trigger_error() was introduced in 6.4.0 (the same version WP_Font_Face was introduced), we can now safely replace these calls to resolve the @todos.
This ticket updates the four instances in src/wp-includes/fonts/class-wp-font-face.php to use wp_trigger_error() instead of _doing_it_wrong().
*I will attach a Pull Request that addresses this issue shortly.*
Change History (2)
This ticket was mentioned in PR #12200 on WordPress/wordpress-develop by @mohamedahamed.
9 hours ago
#1
- Keywords has-patch added
@westonruter commented on PR #12200:
55 minutes ago
#2
Thank you for the PR. Please update the description to include the missing AI disclosure.
This PR replaces the four instances of
_doing_it_wrong()inWP_Font_Face::validate_font_face_declarations()withwp_trigger_error().This resolves the inline
@todocomments. Sincewp_trigger_error()was introduced in WordPress 6.4.0 alongside the Fonts API, it is the preferred, modernized approach for triggering developer notices in core.Trac ticket: https://core.trac.wordpress.org/ticket/65475
## Use of AI Tools
AI assistance: No
---