From 983941e5426496e152f6bad76c428631124ed922 Mon Sep 17 00:00:00 2001 From: Jonas Kjaergaard Date: Thu, 20 Dec 2018 10:32:00 +0100 Subject: [PATCH] IVD-550: Added Cxense shuffle functions --- src/Services/WidgetDocumentQuery.php | 9 +++++++++ src/Settings/SettingsPage.php | 5 +++++ wp-cxense.php | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Services/WidgetDocumentQuery.php b/src/Services/WidgetDocumentQuery.php index 488d02c..47a5cc0 100644 --- a/src/Services/WidgetDocumentQuery.php +++ b/src/Services/WidgetDocumentQuery.php @@ -116,6 +116,15 @@ public function byRecentlyViewed() return $this; } + /** + * @return $this + */ + public function byShuffle() + { + $this->arrPayload['widgetId'] = WpCxense::instance()->settings->getShuffleWidgetId(); + return $this; + } + /** * @return $this */ diff --git a/src/Settings/SettingsPage.php b/src/Settings/SettingsPage.php index 6089fee..141ad97 100644 --- a/src/Settings/SettingsPage.php +++ b/src/Settings/SettingsPage.php @@ -138,6 +138,11 @@ public function getSortbyWidgetId($locale = null) return $this->getSettingValue('sortby_widget_id', $locale); } + public function getShuffleWidgetId($locale = null) + { + return $this->getSettingValue('shuffle_widget_id', $locale); + } + public function enableQueryCache($locale = null) { return $this->getSettingValue('enable_query_cache', $locale); diff --git a/wp-cxense.php b/wp-cxense.php index bacc606..bf7fcb9 100644 --- a/wp-cxense.php +++ b/wp-cxense.php @@ -1,7 +1,7 @@