Skip to content

Commit

Permalink
Fix: Undefined array key sub_type
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS committed Jan 26, 2024
1 parent ff1c36a commit 5cf2359
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 = $_POST['sub_type'] ?? '';
if ( 'variant' === $sub_type ) {
$status = $this->videos->update_bc_video( $updated_data, sanitize_text_field( $sub_type ) );
} else {
$status = $this->videos->update_bc_video( $updated_data );

Expand Down

0 comments on commit 5cf2359

Please sign in to comment.