public function postStatusChange($new_status, $old_status, $post) { // get all widgets linked to this post and mark them as not published $statuses = array("inherit", "publish"); // we don't handle "inherit" status because it not the real post, but the revision // we don't handle "publish" status because it's handled in: "kaltura_publish_post" if (!in_array($new_status, $statuses)) { $widgets = Kaltura_WPModel::getWidgetsByPost($post->ID); Kaltura_WPModel::unpublishWidgets($widgets); } }