Support » Plugin: Greg's Threaded Comment Numbering » [Plugin: Greg's Threaded Comment Numbering] Can I return the comment number?

  • Resolved helgatheviking

    (@helgatheviking)


    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>';

    http://wordpress.org/extend/plugins/gregs-threaded-comment-numbering/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor gregmulhauser

    (@gregmulhauser)

    Hi,

    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,
    Greg

    yay! excellent work Greg. thanks for the update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Greg's Threaded Comment Numbering] Can I return the comment number?’ is closed to new replies.