aboutsummaryrefslogtreecommitdiff
path: root/user/plugins/hyphens-in-urls/plugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'user/plugins/hyphens-in-urls/plugin.php')
-rw-r--r--user/plugins/hyphens-in-urls/plugin.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/user/plugins/hyphens-in-urls/plugin.php b/user/plugins/hyphens-in-urls/plugin.php
new file mode 100644
index 0000000..3803412
--- /dev/null
+++ b/user/plugins/hyphens-in-urls/plugin.php
@@ -0,0 +1,19 @@
+<?php
+/*
+Plugin Name: Allow Hyphens in Short URLs
+Plugin URI: http://yourls.org/
+Description: Allow hyphens in short URLs (like <tt>http://sho.rt/hello-world</tt>)
+Version: 1.0
+Author: Ozh
+Author URI: http://ozh.org/
+*/
+
+// No direct call
+if( !defined( 'YOURLS_ABSPATH' ) ) die();
+
+yourls_add_filter( 'get_shorturl_charset', 'ozh_hyphen_in_charset' );
+function ozh_hyphen_in_charset( $in ) {
+ return $in.'-';
+}
+
+