Activate.php
1.29 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
<?php
namespace Favorites\Activation;
/**
* Plugin Activation
*/
class Activate
{
public function __construct()
{
$this->setOptions();
}
/**
* Default Plugin Options
*/
private function setOptions()
{
if ( !get_option('simplefavorites_dependencies')
&& get_option('simplefavorites_dependencies') !== "" ){
update_option('simplefavorites_dependencies', [
'css' => 'true',
'js' => 'true'
]);
}
if ( !get_option('simplefavorites_users')
&& get_option('simplefavorites_users') !== "" ){
update_option('simplefavorites_users', [
'anonymous' => [
'display' => 'true',
'save' => 'true'
],
'saveas' => 'cookie'
]);
}
if ( !get_option('simplefavorites_display')
&& get_option('simplefavorites_display') !== "" ){
update_option('simplefavorites_display', [
'buttontext' => __('Favorite <i class="sf-icon-star-empty"></i>', 'favorites'),
'buttontextfavorited' => __('Favorited <i class="sf-icon-star-full"></i>', 'favorites'),
'posttypes' => [
'post' => [
'display' => true,
'after_content' => true,
'postmeta' => true
]
]
]);
}
if ( !get_option('simplefavorites_cache_enabled')
&& get_option('simplefavorites_cache_enabled') !== "" ){
update_option('simplefavorites_cache_enabled', 'true');
}
}
}