-
Notifications
You must be signed in to change notification settings - Fork 11
["BUG"] Notice: Function wp_enqueue_style was called incorrectly #101
Copy link
Copy link
Closed
Labels
bugReport of or fix for something that isn't working as intendedReport of or fix for something that isn't working as intendedhelp wantedReady to be picked up by anyone in the communityReady to be picked up by anyone in the community
Description
Describe the bug
When the plugin is activated, the admin page shows a strong warning:
Notice: Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the openedx-commerce handle. Please see [Debugging in WordPress](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) for more information. (This message was added in version 3.3.0.) in /www/stagingwoocommerceplugin_283/public/wp-includes/functions.php on line 6085
This is not breaking any functionality, but it is annoying and we should fix it.
To Reproduce
Steps to reproduce the behavior:
- Go to
/wp-admin/plugins.php - Click on "Open edX Commerce" > Activate
- See error
Screenshots
Additional context
I think this is related to a direct call to $this->loader->wp_enqueue_style here. We should add_action at admin_enqueue_scripts as the lines before do.
The styles we are including there are used for the log box in the sync manager

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugReport of or fix for something that isn't working as intendedReport of or fix for something that isn't working as intendedhelp wantedReady to be picked up by anyone in the communityReady to be picked up by anyone in the community
