10up / brightcove-video-connect

A plugin to integrate your Brightcove video library or libraries with WordPress
https://www.brightcove.com/
GNU General Public License v2.0
22 stars 34 forks source link

Fix for custom post types and brightcove block. #388

Closed jonnynews closed 6 months ago

jonnynews commented 7 months ago

Description of the Change

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 #387

How to test the Change

Changelog Entry

Added - New feature Changed - Existing functionality Deprecated - Soon-to-be removed feature Removed - Feature Fixed - Bug fix Security - Vulnerability

Credits

Props @spacedmonkey

Checklist:

oscarssanchezz commented 6 months ago

Closing this one as we merged https://github.com/10up/brightcove-video-connect/pull/389

It seems this one was branched from master.