PluginProbe
FileBird – WordPress Media Library Folders & File Manager / 5.6.2
FileBird – WordPress Media Library Folders & File Manager v5.6.2
6.5.8 6.5.7 6.5.5 6.5.4 trunk 4.3.1 5.1.6 5.3 5.3.2 5.4.3 5.4.4 5.4.5 5.5 5.5.3 5.5.5 5.5.8 5.5.8.1 5.6 5.6.1 5.6.2 5.6.3 5.6.4 6.2.3 6.2.5 6.3 All 36 releases
filebird / includes / Install.php

Install.php in FileBird – WordPress Media Library Folders & File Manager 5.6.2, at includes/Install.php

42 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace FileBird;
3
4 defined( 'ABSPATH' ) || exit;
5
6 class Install {
7 public static function create_tables() {
8 global $wpdb;
9
10 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
11
12 $charset_collate = $wpdb->get_charset_collate();
13
14 $table_fbv = $wpdb->prefix . 'fbv';
15 //type == 0: folder
16 //type == 1: collection
17 if ( $wpdb->get_var( "show tables like '{$wpdb->prefix}fbv'" ) != $table_fbv ) {
18 $sql = 'CREATE TABLE ' . $table_fbv . ' (
19 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
20 `name` varchar(250) NOT NULL,
21 `parent` int(11) NOT NULL DEFAULT 0,
22 `type` int(2) NOT NULL DEFAULT 0,
23 `ord` int(11) NULL DEFAULT 0,
24 `created_by` int(11) NULL DEFAULT 0,
25 PRIMARY KEY (id),
26 UNIQUE KEY `id` (id)) ' . $charset_collate . ';';
27 dbDelta( $sql );
28 }
29
30 $table = $wpdb->prefix . 'fbv_attachment_folder';
31 //type == 0: folder
32 //type == 1: collection
33 if ( $wpdb->get_var( "show tables like '{$wpdb->prefix}fbv_attachment_folder'" ) != $table ) {
34 $sql = 'CREATE TABLE ' . $table . ' (
35 `folder_id` int(11) unsigned NOT NULL,
36 `attachment_id` bigint(20) unsigned NOT NULL,
37 PRIMARY KEY( `folder_id`, `attachment_id`)
38 )' . $charset_collate . ';';
39 dbDelta( $sql );
40 }
41 }
42 }