urlencode for Pinterest image
Hi, im looking for how to add image url to the pinterest pin. The code needed urlencode for image. I know we can take the first image url with :
<?php echo cp_get_image_url_raw($post->ID); ?> code. But how do we urlencode it? Anyone to help?
Here is what needed for pinterest code :
<a href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink()); ?>&media=<?php echo urlencode(wp_get_attachment_url(get_post_thumbnail _id())); ?>&description=<?php echo urlencode( get_the_title()); ?>" class="pin-it-button" count-layout="none">Pin It</a>
<script type="text/javascript" src="http://assets.pinterest.com/
js/pinit.
js"></script>
Thanks in advance!