A timeline of the last four years of detecting good old window.localStorage
.
October 2009: 5059daa
function string_to_slug (str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |
<?php | |
add_filter('content_save_pre', 'cleanup_annoying_writers'); | |
function cleanup_annoying_writers($content) | |
{ | |
remove_filter('content_save_pre', array($this, 'cleanup_annoying_writers')); | |
$content =trim(stripslashes($content)); | |
//No JS |
A timeline of the last four years of detecting good old window.localStorage
.
October 2009: 5059daa