Last active
August 29, 2015 14:00
-
-
Save robneu/11245426 to your computer and use it in GitHub Desktop.
As of version 2.74, the Disqus plugin has a bug that produces warrning notices when trying to connect to the WordPress database. This should fix the issue.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Ignore the <?php tag, it's only here for syntax highlighting. | |
// This can be found on line 285 of disqus.php | |
$commentdata = $wpdb->get_row($wpdb->prepare( "SELECT comment_ID, comment_parent FROM $wpdb->comments WHERE comment_agent = 'Disqus/1.0:{$comment->id}' LIMIT 1"), ARRAY_A); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Ignore the <?php tag, it's only here for syntax highlighting. | |
// Replace the code on line 285 of disqus.php with the following: | |
$commentdata = $wpdb->get_row( $wpdb->prepare( "SELECT comment_ID, comment_parent FROM $wpdb->comments WHERE comment_agent = 'Disqus/1.0:%d' LIMIT 1", $comment->id ), ARRAY_A ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you need more information, you can find a detailed post on this code here: http://wpbacon.com/tutorials/disqus-plugin-php-errors