| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | Plugin Name: Minimalist Error |
|---|
| 4 | Plugin URI: |
|---|
| 5 | Description: Minimalist plugin to show error on activate/deactivate/reactivate |
|---|
| 6 | Version: 1.0 |
|---|
| 7 | Author: Colin J. Hahn |
|---|
| 8 | Author URI: |
|---|
| 9 | */ |
|---|
| 10 | |
|---|
| 11 | register_activation_hook( __FILE__, 'minimalist_database_setup'); |
|---|
| 12 | |
|---|
| 13 | function minimalist_database_setup() { |
|---|
| 14 | |
|---|
| 15 | global $wpdb; |
|---|
| 16 | $table = $wpdb->prefix . 'minimalist'; |
|---|
| 17 | |
|---|
| 18 | $sql = "CREATE TABLE $table ( |
|---|
| 19 | id bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
|---|
| 20 | filler text, |
|---|
| 21 | PRIMARY KEY id (id) |
|---|
| 22 | );"; |
|---|
| 23 | |
|---|
| 24 | require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|---|
| 25 | |
|---|
| 26 | dbDelta( $sql ); |
|---|
| 27 | |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | ?> |
|---|