Describe the bug
On PHP 8+, WP Job Manager triggers warnings for an undefined array key widget_id in WP_Job_Manager_Widget::get_cached_widget() and cache_widget(). The code assumes $args['widget_id'] is always present. The widget should gracefully handle missing widget_id values (e.g. by skipping caching) to avoid PHP warnings and ensure PHP 8+ compatibility.
To Reproduce
Steps to reproduce the behavior:
- Go to 'WP Dashboard -> Appearance -> Widgets"
- Add "Recent/Featured Jobs" widget
- Save Changes
- See error in debug.log
Isolating the problem (mark completed items with an [x]):
WordPress Environment
- WordPress Version: 6.9
- WP Job Manager Version: 2.4.0
- PHP Version: 8+
Describe the bug
On PHP 8+, WP Job Manager triggers warnings for an undefined array key widget_id in
WP_Job_Manager_Widget::get_cached_widget()andcache_widget(). The code assumes$args['widget_id']is always present. The widget should gracefully handle missing widget_id values (e.g. by skipping caching) to avoid PHP warnings and ensure PHP 8+ compatibility.To Reproduce
Steps to reproduce the behavior:
Isolating the problem (mark completed items with an [x]):
WordPress Environment