Opened 2 years ago
Last modified 2 years ago
#61242 new defect (bug)
PHP warning when `'taxonomies'` in `register_post_type` is set to `false` instead of `array()`
| Reported by: | siddiquesaad | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Posts, Post Types | Version: | 6.5.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
It shows this warning everywhere.
Warning: Invalid argument supplied for foreach() in /public_html/wp-includes/class-wp-post-type.php on line 753
Change History (3)
This ticket was mentioned in PR #6570 on WordPress/wordpress-develop by @siddiquesaad.
2 years ago
#1
- Keywords has-patch added
#2
@
2 years ago
- Component General → Posts, Post Types
- Focuses coding-standards php-compatibility removed
Why/How are you passing false there in the first place when it needs to be an array?
#3
@
2 years ago
What @swissspidy said. Additionally, if this warning occurs, there must be a coding error somewhere, which is exactly what the warning is telling you about. Such warnings should never be hidden, as that hides useful information about a bug which needs to be fixed.
The bug should be fixed in the place where it originates, which can be found via a backtrace.
The current patch is definitely not the way to go.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: [](https://core.trac.wordpress.org/ticket/61242#ticket)