Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Created February 17, 2012 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomasgriffin/1849495 to your computer and use it in GitHub Desktop.
Save thomasgriffin/1849495 to your computer and use it in GitHub Desktop.
function nirvana_install() {
global $wpdb;
$table = 'dynamic_sidebars';
$dynamic_sidebars = $wpdb->prefix . $table;
$sql = $wpdb->prepare( "CREATE TABLE $dynamic_sidebars (
dynamic_sidebar_id BIGINT(20) NOT NULL AUTO_INCREMENT,
sidebar_name VARCHAR(255) NOT NULL,
sidebar_id VARCHAR(255) NOT NULL,
description MEDIUMTEXT NULL,
before_widget MEDIUMTEXT NULL,
after_widget MEDIUMTEXT NULL,
before_title MEDIUMTEXT NULL,
after_title MEDIUMTEXT NULL,
PRIMARY KEY dynamic_sidebar_id (dynamic_sidebar_id)
)" );
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