aboutsummaryrefslogtreecommitdiffstats
path: root/include/wiki.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/wiki.php')
-rw-r--r--include/wiki.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/wiki.php b/include/wiki.php
index 828121ba9..90b30d492 100644
--- a/include/wiki.php
+++ b/include/wiki.php
@@ -124,3 +124,16 @@ function wiki_delete_wiki($resource_id) {
return array('item' => $item, 'success' => (($drop === 1 && $pathdel) ? true : false));
}
}
+
+function wiki_exists_by_name($name) {
+ $item = q("SELECT id FROM item WHERE resource_type = '%s' AND title = '%s' AND item_deleted = 0 limit 1",
+ dbesc(WIKI_ITEM_RESOURCE_TYPE),
+ dbesc($name)
+ );
+ if (!$item) {
+ return array('id' => null);
+ } else {
+ return array('id' => $item[0]['id']);
+ }
+
+} \ No newline at end of file