Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@silentworks
Created February 24, 2011 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save silentworks/842839 to your computer and use it in GitHub Desktop.
Save silentworks/842839 to your computer and use it in GitHub Desktop.
fix issue within Wordpress 3.1 edit panel and frontend view.
// Mark entries in index to replace comments link.
/* Patched with version check for WP 3.1 */
function dsq_comments_number($count) {
global $post, $wp_version;
$ver_check = explode('.', $wp_version);
if($ver_check[0] <= 3 && $ver_check[1] < 1){
if ( dsq_can_replace() ) {
return '<span class="dsq-postid" rel="'.htmlspecialchars(dsq_identifier_for_post($post)).'">'.$count.'</span>';
} else {
return $count;
}
} else {
return $count;
}
}
/* Patched with version check for WP 3.1 */
function dsq_comments_text($comment_text) {
global $post, $wp_version;
$ver_check = explode('.', $wp_version);
if($ver_check[0] <= 3 && $ver_check[1] < 1){
if ( dsq_can_replace() ) {
return '<span class="dsq-postid" rel="'.htmlspecialchars(dsq_identifier_for_post($post)).'">View Comments</span>';
} else {
return $comment_text;
}
} else {
return $comment_text;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment