This repository has been archived by the owner on May 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdateOptions.php
111 lines (108 loc) · 3.15 KB
/
updateOptions.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
$title = strip_tags(stripslashes($new_instance['title']));
$archSortOrder= 'DESC' ;
if($new_instance['archSortOrder'] == 'ASC') {
$archSortOrder= 'ASC' ;
}
if($new_instance['showPosts'] == 'yes') {
$showPosts= true ;
} else {
$showPosts= false ;
}
if($new_instance['linkToArch'] == 'yes') {
$linkToArch= true ;
} else {
$linkToArch= false;
}
if (isset($new_instance['showPostCount'])) {
$showPostCount= true ;
} else {
$showPostCount= false ;
}
if (isset($new_instance['showArchives'])) {
$showArchives= true ;
} else {
$showArchives= false ;
}
if (isset($new_instance['showYearCount'])) {
$showYearCount= true ;
} else {
$showYearCount= false ;
}
if (isset($new_instance['expandCurrentYear'])) {
$expandCurrentYear= true ;
} else {
$expandCurrentYear= false ;
}
$expand= $new_instance['expand'];
$customExpand= $new_instance['customExpand'];
$customCollapse= $new_instance['customCollapse'];
$noTitle= $new_instance['noTitle'];
$inExcludeYear= $new_instance['inExcludeYear'];
$inExcludeCat= $new_instance['inExcludeCat'];
if(isset($new_instance['expandYears'])) {
$expandYears= true ;
} else {
$expandYears=false;
}
if (isset($new_instance['showMonthCount'])) {
$showMonthCount= true ;
} else {
$showMonthCount=false;
}
if (isset($new_instance['expandMonths'])) {
$expandMonths= true ;
} else {
$expandMonths=false;
}
if (isset($new_instance['showPostTitle'])) {
$showPostTitle= true ;
} else {
$showPostTitle=false;
}
if( !isset($new_instance['accordion'])) {
$accordion= 0 ;
} else {
$accordion=1;
}
if (isset($new_instance['debug'])) {
$debug= true ;
} else {
$debug= false;
}
if( isset($new_instance['showPostDate'])) {
$showPostDate= true ;
} else {
$showPostDate=false;
}
$postDateFormat=addslashes($new_instance['postDateFormat']);
$postDateAppend= 'after' ;
if($new_instance['postDateAppend'] == 'before') {
$postDateAppend= 'before' ;
}
if(isset($new_instance['expandCurrentMonth'])) {
$expandCurrentMonth= true ;
} else {
$expandCurrentMonth= false ;
}
$inExcludeYears=addslashes($new_instance['inExcludeYears']);
$postTitleLength=addslashes($new_instance['postTitleLength']);
$inExcludeCats=addslashes($new_instance['inExcludeCats']);
$defaultExpand=addslashes($new_instance['defaultExpand']);
$taxonomy= $new_instance['taxonomy'];
$post_type= $new_instance['post_type'];
$useCookies=true;
if (!isset($new_instance['useCookies'])) {
$useCookies= false ;
}
/* update style settings */
$style = $new_instance['style'];
$instance = compact( 'title','showPostCount', 'style', 'useCookies',
'inExcludeCat', 'inExcludeCats', 'inExcludeYear', 'inExcludeYears',
'archSortOrder', 'showPosts', 'showPages', 'linkToArch', 'debug',
'showYearCount', 'expandCurrentYear','expandMonths', 'expandYears',
'expandCurrentMonth','showMonthCount', 'showPostTitle', 'expand',
'noTitle', 'customExpand', 'customCollapse', 'postDateAppend',
'post_type', 'taxonomy',
'showPostDate', 'postDateFormat','accordion','postTitleLength');
?>