[wp-hackers] related posts 1.3.3 issue cont.

Mark Jaquith mark.wordpress at txfx.net
Wed Oct 27 20:22:18 UTC 2004


Alexander Malov wrote:

>I've been trying to add a condition to my plugin to replace entry
>links to posts w/ no title (this happens when somebody imported from
>blogger) to display a generic link. I tried the following code:
>
>if ($result->post_title = ' ') {
>$title = 'Generic link title';
>}
>
>But it affects all titles for reasons unknown to me ... yeah, I know.
>If anyone can point me in the right direction I would be very
>grateful.
>
>
>  
>
I once made the same mistake and nearly tore the hair from my scalp.

remember, "=" sets equality, "==" tests for equality.

if ($result->post_title == ' ') {
$title = 'Generic link title';
}






More information about the hackers mailing list