This repository was archived by the owner on May 2, 2022. It is now read-only.

Description
Describe the bug
If you modify the array that the get_enqueue_contexts method returns, a new WP_Error object is created and returned when performing the in_array check in several methods. This causes a somewhat cryptic error being thrown as at that point you are attempting to enqueue a script or stylesheet with a WP_Error object as the style/script path string.
Steps to Reproduce
- Clone the repo
- Run
npm run-script start, yarn start, etc.
- Remove
admin from return [ 'admin', 'frontend', 'shared' ]; on line 86 of core.php
- Activate the plugin
Expected behavior
Display a WordPress warning/error on the back-end with the messages passed to the WP_Error constructors.
Screenshots
Catchable fatal error: Object of class WP_Error could not be converted to string in /var/www/html/wp-includes/http.php on line 681
...