dashes to underscores perm
-
Hey guys,
As a few topics here already cover, I’m trying to find a better way to convert my underscores to dashes more permanently within the WP system.While:
add_filter( ‘sanitize_title’, ‘dashes_to_underscore’ );
function dashes_to_underscore( $title ){
return str_replace( ‘-‘, ‘_’, $title );
}Has worked for me, I noticed that none of my sidebars worked.
I was more-so wondering if you guys had a better solution (as my team and I publish several entries a day on a few blogs and update the permalink manually is a bit of a hassle when you have long titles.
I rewrote the code a bit to:
add_filter( ‘sanitize_file_name’, ‘dashes_to_underscore’ );
function dashes_to_underscore( $title ){
return str_replace( ‘-‘, ‘_’, $title );
}and was wondering if you guys forsee any issue with this OR if you know how to make it work at all without affecting anything but my post titles.
Thanks
- The topic ‘dashes to underscores perm’ is closed to new replies.