Opened 15 months ago
Closed 15 months ago
#63235 closed defect (bug) (wontfix)
Getting "Overriding WordPress globals is prohibited. Found assignment to $post" errors into the core files.
| Reported by: | viralsampat | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | dev-feedback 2nd-opinion needs-testing |
| Cc: | Focuses: | coding-standards |
Description
Hello Team,
I have checked WordPress core files and I have found this "Overriding WordPress globals is prohibited. Found assignment to $post" error for few files. I think that it should be resolve.
src/wp-includes/blocks/latest-posts.php
src/wp-includes/wp-includes/blocks/comments.php
src/wp-includes/class-wp-block.php
src/wp-includes/class-wp-query.php
src/wp-includes/widgets/class-wp-widget-custom-html.php
src/wp-includes/widgets/class-wp-widget-text.php
src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php
I have tested this into the WordPress 6.8-beta1.
Thanks,
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This rule is for plugin and developers who might be overriding WordPress globals.
But WordPress is WordPress, so this rule doesn't apply for core :-)