-
Notifications
You must be signed in to change notification settings - Fork 5
/
spin360act.php
34 lines (27 loc) · 883 Bytes
/
spin360act.php
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
<?php
/**
* Class spin360activation
* Actions when plugin is activated
*/
class spin360activation {
public function __construct()
{
register_activation_hook( SPIN360_PLUGIN_MAIN, array($this,'spin360_activation_hook'));
}
public function spin360_activation_hook() {
$this->spin360_check_products_folder_initialized();
}
// Creates spin360 folder in uploads, if it already does not exist
private function spin360_check_products_folder_initialized()
{
// $wp_uploads = wp_upload_dir();
// $products_path = $wp_uploads['basedir'].'/spin360show';
$products_path = SPIN360_UPLOAD_PATH;
if(!file_exists($products_path)){
//create directory
if (wp_mkdir_p($products_path)) {
echo 'It worked! Now look for the directory';
}
}
}
}//class