Skip to content

Commit

Permalink
Merge pull request #370 from 10up/fix/354
Browse files Browse the repository at this point in the history
Fix: Undefined array key sub_type
  • Loading branch information
MARQAS authored Feb 15, 2024
2 parents 9e68966 + abd3661 commit d63145c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/admin/api/class-bc-admin-media-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ public function bc_ajax_update_video_or_playlist() {

} elseif ( 'videos' === $_POST['type'] ) {
$type_msg = 'video';
if ( 'variant' === $_POST['sub_type'] ) {
$status = $this->videos->update_bc_video( $updated_data, sanitize_text_field( $_POST['sub_type'] ) );
$sub_type = isset( $_POST['sub_type'] ) ? sanitize_text_field( $_POST['sub_type'] ) : '';
if ( 'variant' === $sub_type ) {
$status = $this->videos->update_bc_video( $updated_data, $sub_type );
} else {
$status = $this->videos->update_bc_video( $updated_data );

Expand Down

0 comments on commit d63145c

Please sign in to comment.