[wp-trac] [WordPress Trac] #63221: Deprecated Warning in wp_parse_list() When Passing Null Value
WordPress Trac
noreply at wordpress.org
Wed Apr 2 11:46:58 UTC 2025
#63221: Deprecated Warning in wp_parse_list() When Passing Null Value
-------------------------------+-----------------------------
Reporter: dilipbheda | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords: has-patch
Focuses: php-compatibility |
-------------------------------+-----------------------------
When calling `wp_parse_list( get_option( 'custom_theme_settings', null )
)`, a deprecated warning appears in PHP 8.1+ due to passing `null` to
`preg_split()`.
{{{
Deprecated: preg_split(): Passing null to parameter #2 ($subject) of type
string is deprecated
in /var/www/html/codeinwp/wp-includes/functions.php on line 4967
}}}
**Steps to Reproduce:**
1. Call `get_option( 'custom_theme_settings', null )` where the option
does not exist.
2. Pass the result to `wp_parse_list()`
3. Observe the deprecated warning in PHP 8.1+
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63221>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list