Ensure that the get_current_screen is not null. Also check is the base is "post" and not the id. If ID can be set to "page" or "article" for custom post types. So this check for $current_screen->id === 'post' is invalid.
The conditional statements in class-bc-setup.php have been updated to improve fetching folders and players. The revised conditions not only check for user permission and page type, but they also ensure that the $current_page variable is defined before attempting to access its properties. This adds an extra layer of validation to prevent potential errors.
Description of the Change
Taken from: https://github.com/10up/brightcove-video-connect/pull/388
Ensure that the get_current_screen is not null. Also check is the base is "post" and not the id. If ID can be set to "page" or "article" for custom post types. So this check for $current_screen->id === 'post' is invalid.
The conditional statements in class-bc-setup.php have been updated to improve fetching folders and players. The revised conditions not only check for user permission and page type, but they also ensure that the $current_page variable is defined before attempting to access its properties. This adds an extra layer of validation to prevent potential errors.
Closes https://github.com/10up/brightcove-video-connect/issues/387
How to test the Change
Changelog Entry
Credits
Props @spacedmonkey, @jonnynews
Checklist: