I'm writing a plugin to add some extra contents that contain the permanent link to the (single) post.
function abcd_add_contents($content) {
$extra_content = the_permalink();
if (is_single()) {
$content .= $extra_content;
}
return $content;
}
add_filter('the_content', 'abcd_add_contents');
the_permalink() does not work. How can I obtain the permanent link information of the current post in this plugin function?