aboutsummaryrefslogtreecommitdiff
path: root/user/plugins/hyphens-in-urls/plugin.php
blob: 380341214825842288f1a8e59f58bc8c4b84474e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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.'-';
}