dashboard_glance_items is a filter, not an action
-
Hi there,
I traced an error on one of my sites back to the use of the dashboard_glance_items filter as an action in your plugin.
Basically, the Dashboard was erroring out trying to generate the At a Glance block because the Timed Content plugin wasn’t modifying or returning the array being passed into it and other functions on that hook were expecting one. (Event Tickets is using strict typing on their hook to ensure an array is rightfully returned, and the null value coming in makes it throw an error.)
Easy fix is to change it from add_action to add_filter, add a parameter to the TimedContentPlugin->add_rules_count method, and return that both in the post type guard clause at the beginning and at the very end of the function.
Thanks!
- The topic ‘dashboard_glance_items is a filter, not an action’ is closed to new replies.