From fd9a41f9575b887772b8ff6f74350c5f63fdc2ed Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 28 Apr 2014 15:09:07 +0200 Subject: [PATCH] Quickfix so WP can get the id of new content. (used for redirect) --- h5p.classes.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/h5p.classes.php b/h5p.classes.php index 60454ce..78ef106 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -947,6 +947,8 @@ class H5PStorage { public $h5pF; public $h5pC; + + public $contentId = NULL; // Quick fix so WP can get ID of new content. /** * Constructor for the H5PStorage @@ -1037,6 +1039,7 @@ class H5PStorage { $contentJson = file_get_contents($current_path . DIRECTORY_SEPARATOR . 'content.json'); $mainLibraryId = $librariesInUse['preloaded-' . $this->h5pC->mainJsonData['mainLibrary']]['library']['libraryId']; $contentId = $this->h5pF->saveContentData($contentJson, $this->h5pC->mainJsonData, $mainLibraryId, $contentMainId, $contentId); + $this->contentId = $contentId; $contents_path = $this->h5pF->getH5pPath() . DIRECTORY_SEPARATOR . 'content'; if (!is_dir($contents_path)) {