Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update condition for fetching folders and players #389

Merged
merged 1 commit into from
May 7, 2024

Conversation

oscarssanchezz
Copy link
Collaborator

@oscarssanchezz oscarssanchezz commented May 6, 2024

Description of the Change

Taken from: #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 #387

How to test the Change

Changelog Entry

Fixed - Cannot use Brightcove block on custom post types.

Credits

Props @spacedmonkey, @jonnynews

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@oscarssanchezz oscarssanchezz merged commit 5205243 into develop May 7, 2024
13 checks passed
@oscarssanchezz oscarssanchezz deleted the fix/loading-script branch May 7, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brightcove block not working in custom post type
3 participants