Opened 8 years ago
Closed 8 years ago
#45236 closed defect (bug) (fixed)
Cast the result of the `default_content`, `default_title`, and `default_excerpt` filters
| Reported by: | dd32 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.0 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | has-patch commit fixed-5.0 |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Looks good to me.