public static function slug($title) { $title = (string) $title; $title = strtolower($title); $title = trim($title); $title = substr($title, 0, 75); $title = Stuffpress_Permalink::removeaccents($title); $title = preg_replace('/[^a-z0-9- ]/', '', $title); // remove all non-alphanumeric characters except for spaces and hyphens $title = str_replace(' ', '-', $title); return $title; }