[wp-hackers] filtering french characters in the_title
scribu
scribu at gmail.com
Mon Oct 19 12:41:34 UTC 2009
On Mon, Oct 19, 2009 at 3:37 PM, Simon Blackbourn <piemanek at gmail.com>wrote:
> Hi
>
> I'm developing a multi-lingual site that uses password-protected posts, and
> my client doesn't want the word 'protected' to appear anywhere.
>
> I'm filtering the_title like so:
>
> add_filter( 'the_title', 'no_prot_in_title' );
>
> function no_prot_in_title( $title ) {
>
> $pattern[0] = '/Protected:/'; // english
> $pattern[1] = '/Protegido:/'; // spanish
> $pattern[2] = '/Protégé :/'; // french
> $replacement[0] = '';
> $replacement[1] = '';
> $replacement[2] = '';
>
> return preg_replace( $pattern, $replacement, $title );
>
> }
>
Try this:
return str_replace(__('Protected:'), '', $title);
--
http://scribu.net
More information about the wp-hackers
mailing list