Opened 7 years ago
Closed 7 years ago
#45236 closed defect (bug) (fixed)
Cast the result of the `default_content`, `default_title`, and `default_excerpt` filters
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 5.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Editor | Keywords: | has-patch commit fixed-5.0 |
| Focuses: | Cc: |
Description
WordPress expects that the result of the default_* post filters are strings, but PHP isn't very strict about what an empty string is.
Gutenberg has run into an issue when the filters return null: https://github.com/WordPress/gutenberg/issues/11176
It seems reasonable to expect that the related values within the default $post object are strings (ref of where it's used)
Attached patch does just this, casting to a string to allow Gutenberg to receive the empty string that it expects in this case.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Looks good to me.