in reply to WordPress 'sanitize_title'
so where is apply_filters? How about you find it? Should be easy since WordPress is open source$title = apply_filters('sanitize_title', $title);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: WordPress 'sanitize_title'
by Klammer (Acolyte) on Sep 01, 2008 at 16:33 UTC | |
> So you found sanitize_title (you're good enough at PHP) Well, I didn't find it by checking the source but during a google research. Someone pointed to the sanitize_title function when it comes to permalink creation. So I downloaded the WordPress source code and found it in formatting.php. To be honest I also found the apply_filters function in wp-includes/plugin.php when trying to understand what "sanitize_title" does. But apply_filters as well as sanitize_title gives me no clue what WordPress does to convert the title. I expected to find some php string manipulation but apply_filters is all greek to me.
My hope and the reason for my posting was, that someone already has written a module/function/... in Perl that accomplished this. It seems this is not the case. Cheers Klammer | [reply] [d/l] |
by Anonymous Monk on Sep 01, 2008 at 16:38 UTC | |
http://www.w3schools.com/php/func_string_strip_tags.asp http://www.php.net/preg_replace http://www.php.net/strip_tags http://www.php.net/trim http://www.php.net/strtolower WordPress › Support » How does WP remove accents from Polish characters? http://codex.wordpress.org/Function_Reference_2.0.x http://adambrown.info/p/wp_hooks/hook/sanitize_title?version=2.6&file=wp-includes/formatting.php http://postedpost.com/2008/06/22/hack-wordpress-sanitize-title-function/ http://postedpost.com/2008/06/23/ultimate-wordpress-post-name-url-sanitize-solution/ | [reply] [d/l] |
by Klammer (Acolyte) on Sep 01, 2008 at 17:13 UTC | |
> You're just being lazy.In defense I can only say, that I'm not a good perl scripter too. :) I'm really trying hard. I don't expect anybody to write this for me in case you fear I'm that sort of guy. As far as I understand your posted code, sanitize_title_with_dashes is the function to look for. Finally some string manipulation. :) Thanks for all the other helpful links. I'll have a look at it and will try to convert sanitize_title_with_dashes into perl code. Cheers Klammer | [reply] |