Created
December 11, 2012 21:21
-
-
Save skyebook/4262228 to your computer and use it in GitHub Desktop.
WPDB::Prepare Fix for WordPress 3.5
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 | |
// Old (single argument) function call | |
global $wpdb; | |
$authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1"); | |
// New (two argument) function call | |
global $wpdb; | |
$authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1", array())); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment