Greg's Threaded Comment Numbering
[resolved] Can I return the comment number? (3 posts)

  1. helgatheviking
    Posted 5 years ago #

    For better inclusion in my theme, I am wondering if it is possible to just return the content number variable. It seems to echo out (even without its wrapper) and not go where I need it to.

    //If Greg's Threaded Comment numbering exists then we make the permalink the comment number
    		 if(function_exists('gtcn_comment_numbering')) {
    			$text = gtcn_comment_numbering($comment->comment_ID, $args);
    		} else {
    			$text = 'Permalink';

    if the function exists the Number gets outputted whereever it feels like, but if it doesn't exist then 'Permalink' is properly added to the sprint replace

    $content .= '<span class="comment-permalink">' . sprintf( __('<a href="%1$s" title="Permalink to this comment">%2$s</a>', 'thematic' ), '#comment-' . get_comment_ID(), $text ) . '</span>';


  2. gregmulhauser
    Plugin Author

    Posted 5 years ago #


    Yipes, sorry about that -- and good catch! The bug is fixed in version 1.4.5, uploaded a few seconds ago. The instructions tab of the plugin's config pages details the addition of an extra parm for the function which will ensure it is returned quietly. (I had to do it this way for backward compatibility -- otherwise, existing code using the function on the assumption it would echo automatically would stop working properly.)

    All the best,

  3. helgatheviking
    Posted 5 years ago #

    yay! excellent work Greg. thanks for the update.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Greg's Threaded Comment Numbering
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic