Skip to content

Commit

Permalink
Merge pull request #389 from 10up/fix/loading-script
Browse files Browse the repository at this point in the history
Update condition for fetching folders and players
  • Loading branch information
oscarssanchezz authored May 7, 2024
2 parents fabd097 + ce0ec65 commit 5205243
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/class-bc-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public static function preload_params() {
$params['folders'] = array();

$current_page = get_current_screen();
if ( BC_Utility::current_user_can_brightcove() && ( 'post' === $current_page->id || false !== strpos( $current_page->id, 'brightcove_page' ) ) ) {
if ( BC_Utility::current_user_can_brightcove() && ( $current_page && ( 'post' === $current_page->base || false !== strpos( $current_page->id, 'brightcove_page' ) ) ) ) {
$params['folders'] = $cms_api->fetch_folders();
$params['labels'] = $cms_api->get_account_labels();
}
Expand Down Expand Up @@ -370,7 +370,7 @@ public static function brightcove_enqueue_assets() {
);

$current_page = get_current_screen();
if ( 'post' === $current_page->id ) {
if ( $current_page && 'post' === $current_page->base ) {
$player_api = new BC_Player_Management_API2();
$players = $player_api->get_all_players();

Expand Down

0 comments on commit 5205243

Please sign in to comment.