| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | +namespace MaxButtons; | |
| 3 | +defined('ABSPATH') or die('No direct access permitted'); | |
| 4 | + | |
| 2 | 5 | class maxInstall |
| 3 | 6 | { |
| 4 | 7 | static function activation_hook($network_wide) { |
| 5 | 8 | if ($network_wide) { |
| @@ -228,9 +231,9 @@ | ||
| 228 | 231 | require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
| 229 | 232 | |
| 230 | 233 | $table_name = maxUtils::get_table_name(); |
| 231 | 234 | $button = new maxButton(); |
| 232 | - $blocks = $button->getDefinedBlocks(); | |
| 235 | + $blocks = $button->getBlocks(); | |
| 233 | 236 | |
| 234 | 237 | // IMPORTANT: There MUST be two spaces between the PRIMARY KEY keywords |
| 235 | 238 | // and the column name, and the column name MUST be in parenthesis. |
| 236 | 239 | $sql = "CREATE TABLE " . $table_name . " ( |
| @@ -242,9 +245,11 @@ | ||
| 242 | 245 | |
| 243 | 246 | |
| 244 | 247 | foreach($blocks as $block) |
| 245 | 248 | { |
| 246 | - $sql .= "" . $block . " TEXT NULL, \n "; | |
| 249 | + $block_name = $block->get_name(); | |
| 250 | + | |
| 251 | + $sql .= "" . $block_name . " TEXT NULL, \n "; | |
| 247 | 252 | } |
| 248 | 253 | |
| 249 | 254 | $sql .= "updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
| 250 | 255 | created TIMESTAMP DEFAULT 0 NOT NULL, |