-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
58 lines (51 loc) · 1.6 KB
/
install.php
File metadata and controls
58 lines (51 loc) · 1.6 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
if ( ! defined( 'ABSPATH' ) )
exit;
function php_code_install(){
if(get_option('php_code_include_path')=='') {
add_option('php_code_include_path', ($_SERVER['DOCUMENT_ROOT'].'/includes/'));
}
}
function php_code_uninstall(){
delete_option("php_code_include_path");
}
register_activation_hook( PHP_CODE_ROOT ,'php_code_install');
register_uninstall_hook( PHP_CODE_ROOT, 'php_code_uninstall' );
/**************** for future DEV
function xyz_ips_network_install($networkwide) {
global $wpdb;
if (function_exists('is_multisite') && is_multisite()) {
// check if it is a network activation - if so, run the activation function for each blog id
if ($networkwide) {
$old_blog = $wpdb->blogid;
// Get all blog ids
$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
foreach ($blogids as $blog_id) {
switch_to_blog($blog_id);
xyz_ips_install();
}
switch_to_blog($old_blog);
return;
}
}
xyz_ips_install();
}
function xyz_ips_network_uninstall($networkwide) {
global $wpdb;
if (function_exists('is_multisite') && is_multisite()) {
// check if it is a network activation - if so, run the activation function for each blog id
if ($networkwide) {
$old_blog = $wpdb->blogid;
// Get all blog ids
$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
foreach ($blogids as $blog_id) {
switch_to_blog($blog_id);
xyz_ips_uninstall();
}
switch_to_blog($old_blog);
return;
}
}
xyz_ips_uninstall();
}
*/