Getting Error “Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated”
Expected behavior
This is a deprecation error and not really major.
Current behavior
Gett error only with Debug on!
Possible solution
Add $query = '';
to line 2925 or wp-includes/wp-db.php
Steps to reproduce
With WPDEBUG set to true
- was troubleshooting a cookie issue
- turned on WPDEBUG manually in wp-config.php
- error appears
- did not test if error appears AFTER I deleted site cookies (my original reason for turning on debug)
Context
Was troubleshooting wp-login issue?
In the real world debug would be set to false so this may not effect anyone but developers.
Solution
Set query string as empty before the ltrim
is asked for to avoid passing null
In wp-db.php I added $query = '';
on line 2925 which is the first BLANK line before the collation query.