I think this is an easy thing, but before I’ve tried to find a solution for almost one an hour.

<a href="http://www.tumblr.com/share/quote?quote=<?php echo urlencode(the_permalink()) ?>&source=<?php echo urlencode(get_the_title()) ?>" title="Share On Tumblr">

results are not yet encoded url:
http://www.tumblr.com/share/quote?quote=http://localhost/wp/how-to-make-cheat/&source=how to make a cheat

because it failed so I tried the code like this:

<?php
$linksf = the_permalink();
echo $linksf;
$linksf = urlencode($linksf);
echo $linksf;
$linksf = urlencode('http://localhost/wp/how-to-make-cheat/');
echo $linksf;
?>

the result is:

> http://localhost/wp/how-to-make-cheat/
> http://localhost/wp/how-to-make-cheat/
> http%3A%2F%2Flocalhost%2Fwp%2Fhow-to-make-cheat%2F

I want is results like this:
http://www.tumblr.com/share/quote?quote=http%3A%2F%2Flocalhost%2Fwp%2Fhow-to-make-cheat%2F&source=how+to+make+a+cheat

Read more here: Encode Url in PHP Problems in WordPress


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: