[wp-hackers] Useless Filter

Nathan Rice ncrice at gmail.com
Tue Feb 17 17:35:03 GMT 2009


My mistake guys and gals. The filter isn't useless.

So I'm not missing anything there, though, right?  There is no current way
of passing variables into a filter function for that particular instance of
the_title?

Nathan

My Website
http://www.nathanrice.net/

My Twitter
http://twitter.com/nathanrice


On Tue, Feb 17, 2009 at 12:29 PM, Jennifer Hodgdon <yahgrp at poplarware.com>wrote:

> In answer to your question at the end of your post: You are missing
> something. There are some plugins that need to filter titles in a way that
> only depends on the text.
>
> If you are interested, one example is multi-lingual plugins. When you edit
> a post, you type something like this in for the post title:
>  [lang_en]Title in English[/lang_en][lang_es]Titulo en Español[/lang_es]
> But when the blog is being viewed, you only display either English or
> Spanish, depending on URL, cookies, etc. That is done with a 'the_title'
> filter, which decides on the language and spits out just one part of that
> text. Independent of post ID, where it is being used, etc.
>
> I'm not saying you shouldn't advocate adding some more information to
> 'the_title', but the current usage is NOT useless.
>
>   --Jennifer
>
>
> Nathan Rice wrote:
>
>> So last night I was trying to build a plugin when I ran across this code
>> in
>> http://svn.automattic.com/wordpress/trunk/wp-includes/classes.php
>>
>> $output .= $indent . '<li class="' . $css_class . '"><a href="' .
>> get_page_link($page->ID) . '" title="' .
>> attribute_escape(apply_filters('the_title', $page->post_title)) . '">' .
>> $link_before . apply_filters('the_title', $page->post_title) . $link_after
>> .
>> '</a>';
>>
> [...]
>
>> Am I missing something, or am I right in thinking that the use of this
>> filter here is completely non-existent?
>>
>
> --
> Jennifer Hodgdon * Poplar ProductivityWare
> www.poplarware.com
>
> Drupal/WordPress Sites, Themes, Modules/Plugins
> Custom Web Programming, Web Databases
> PHP, Perl, MySQL, JavaScript, XML, AJAX
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list