')); // check widget permissions at wordpress db $widgetDb = KalturaWPModel::getWidget($widgetId, $mixId); if (!$widgetDb) wp_die(__('The interactive video was not found (Maybe the post was not published yet?).

')); if (!KalturaHelpers::userCanAdd((string)$widgetDb["add_permissions"])) wp_die(__('You do not have sufficient permissions to access this page.

')); $kmodel = KalturaModel::getInstance(); if (!$mixId) // for backward compatibility { // get the widget from kaltura to find the entry its linked to $widget = $kmodel->getWidget($widgetId); $mixId = $widget->entryId; } if (!$mixId || !$widgetDb) wp_die(__('The video was not found.

')); foreach($entryIds as $entryId) { $kmodel->appendMediaToMix($mixId, $entryId); } ?>