-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
29 lines (22 loc) · 735 Bytes
/
Copy pathinit.php
File metadata and controls
29 lines (22 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
function create_database() {
global $wpdb;
global $map_db_version;
$map_db_version = "1.0";
$table_name = $wpdb->prefix . "map_marker";
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE $table_name (
id int(11) NOT NULL AUTO_INCREMENT,
user_id int(11) NOT NULL,
title longtext,
description longtext,
position char(40),
PRIMARY KEY (id)
) $charset_collate;";
require_once( ABSPATH . '/wp-admin/includes/upgrade.php');
dbDelta( $sql );
add_option('map_db_version', $map_db_version);
}
}
?>