[wp-hackers] Wordpress plugin system

Jeff Minard jeff at jrm.cc
Mon May 30 19:54:07 GMT 2005


Denis de Bernardy wrote:
>>There are already seperate filters for the_title, 
>>the_excerpt, the_content and so on. What exactly are you asking?
> 
> 
> Well, I can filter the_title, straight and simple. But if I want to filter
> the_title this way when post meta blah blah is this, and that way when it's
> that, but not when that other post meta is so... 

Wait a sec. You want to change formatting of "the_title" when the post 
has a meta key of X value, and do it differently when it has a post meta 
key of Y value? That should be possible...

function title_meta_filter($r) {
	global $id;
	if( get_post_meta($id, 'meta_keyX', true) ) {
		//filter for X
	} else if( get_post_meta($id, 'meta_keyY', true) ) {
		// filter for Y
	}

	return $r;
}

Something like that should do the trick in that case.

Or are you seeking something else?

Jeff


More information about the wp-hackers mailing list