aboutsummaryrefslogtreecommitdiffstats
path: root/doc/en/hook/validate_channelname.bb
diff options
context:
space:
mode:
Diffstat (limited to 'doc/en/hook/validate_channelname.bb')
-rw-r--r--doc/en/hook/validate_channelname.bb23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/en/hook/validate_channelname.bb b/doc/en/hook/validate_channelname.bb
new file mode 100644
index 000000000..2ab12bbec
--- /dev/null
+++ b/doc/en/hook/validate_channelname.bb
@@ -0,0 +1,23 @@
+[h2]validate_channelname[/h2]
+
+Called when creating a new channel or changing the channel name in mod/settings.php
+
+Hook data consists of an array
+
+ array(
+ 'name' => supplied name
+ );
+
+ If the hook handler determines the name is valid, do nothing. If there is an issue with the name,
+ set $hook_data['message'] to the message text which should be displayed to the member - and the name will
+ not be accepted.
+
+
+ Example:
+ [code]
+ if(mb_strlen($hook_data['name']) < 3)
+ $hook_data['message'] = t('Name too short.');
+ [/code]
+
+
+ \ No newline at end of file