[wp-hackers] The strangest thing

Ryan McCue ryanmccue at cubegames.net
Tue Jan 22 00:12:51 GMT 2008


Austin Matzko wrote:
> On Jan 21, 2008 11:22 AM, Mário Gamito <gamito at gmail.com> wrote:
>   
>> I'm developing a plugin and the most weird thing happens.
>>
>> Why does this code:
>> $sapo_url='http://tags.sapo.pt/post?v=3&url=' . the_permalink();
>>
>> displays: http://www.absinto.org/?p=38http://tags.sapo.pt/post?v=3&url=
>>
>> Instead of:
>> http://tags.sapo.pt/post?v=3&url=http://www.absinto.org/?p=38
>>     
>
>
> Because "the_permalink" echoes instead of returning the permalink.
> You want "get_permalink" instead.
>   
Which is why it appears before the variable is assigned. Process: echo 
the_permalink() > assign variable > echo variable

Thanks,
Ryan.


More information about the wp-hackers mailing list