Last active
March 21, 2017 14:17
-
-
Save tommcfarlin/cdc5a95834e8bf581fc8ac65fad6ce20 to your computer and use it in GitHub Desktop.
[WordPress] Direct Database Queries in WordPress
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 | |
private function set_all_scheduled_events_as_public() { | |
global $wpdb; | |
// @codingStandardsIgnoreStart | |
$wpdb->query( | |
$wpdb->prepare( | |
" | |
UPDATE $wpdb->posts | |
SET post_status = '%s' | |
WHERE post_type = '%s' | |
AND post_status = '%s' | |
", | |
'publish', | |
'tribe_events', | |
'future' | |
) | |
); | |
// @codingStandardsIgnoreEnd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment