Skip to content

Instantly share code, notes, and snippets.

@holisticnetworking
Created January 5, 2018 17:44
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 holisticnetworking/108983bec87b653322e27d9b65305236 to your computer and use it in GitHub Desktop.
Save holisticnetworking/108983bec87b653322e27d9b65305236 to your computer and use it in GitHub Desktop.
Table creation for scheduling.
private function do_table() {
global $wpdb;
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE $this->table_name (
id mediumint(9) NOT NULL AUTO_INCREMENT,
created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
modified datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
interval TEXT NOT NULL,
object_type TEXT NOT NULL,
PRIMARY KEY (id)
) $charset_collate;";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment