Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix absint Warning #1687

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Fix absint Warning #1687

wants to merge 1 commit into from

Conversation

obenland
Copy link

Fixes a PHP warning when trying to instantiate Author with an stdClass object instead of a user ID:

Warning: Object of class stdClass could not be converted to int in /wordpress/core/6.7.1/wp-includes/load.php on line 1440

Confusingly, get_users() works different to get_posts(), where asking for only IDs still returns an object with only an ID property instead of an array of IDs.

Describe your approach and how it fixes the issue.

Checklist

  • Project documentation has been updated to reflect the changes in this pull request, if applicable.
  • I have tested the changes in the local development environment (see contributing.md).
  • I have added phpunit tests.

Release Changelog

  • Fix: Describe a bug fix included in this release.
  • New: Describe a new feature in this release.

Release Checklist

  • This pull request is to the master branch.
  • Release version follows semantic versioning. Does it include breaking changes?
  • Update changelog in readme.txt.
  • Bump version in stream.php.
  • Bump Stable tag in readme.txt.
  • Bump version in classes/class-plugin.php.
  • Draft a release on GitHub.

Change [ ] to [x] to mark the items as done.

Fixes a PHP warning when trying to instantiate `Author` with an `stdClass` object instead of a user ID:

```
Warning: Object of class stdClass could not be converted to int in /wordpress/core/6.7.1/wp-includes/load.php on line 1440
```

Confusingly, `get_users()` works different to `get_posts()`, where asking for only IDs still returns an object with only an ID property instead of an array of IDs.
@obenland obenland closed this Jan 29, 2025
@obenland obenland deleted the patch-1 branch January 29, 2025 16:00
@obenland obenland restored the patch-1 branch January 29, 2025 17:44
@obenland obenland reopened this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant