Restrict Widgets - Version 1.1.0

Version Description

  • Fix: Show on selected not working in some cases
  • Fix: Restricting on user_logged_in/out
  • Fix: Restricting for Polylang and WPML languages
  • New: Introducing filter rw_display_widget()
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Restrict Widgets
Version 1.1.0
Comparing to
See all releases

Code changes from version 1.0.1.1 to 1.1.0

css/{style.css → restrict-widgets-admin.css} RENAMED
File without changes
js/{restrict-widgets.js → restrict-widgets-admin.js} RENAMED
File without changes
languages/restrict-widgets-pl_PL.mo CHANGED
Binary file
languages/restrict-widgets-pl_PL.po CHANGED
@@ -1,184 +1,189 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Restrict Widgets\n"
4
- "POT-Creation-Date: 2013-03-15 23:14+0100\n"
5
- "PO-Revision-Date: 2013-03-15 23:17+0100\n"
6
- "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
- "Language-Team: dFactory <info@dfactory.eu>\n"
8
- "Language: English\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.5.5\n"
13
- "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
- "X-Poedit-Basepath: .\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-SearchPath-0: ..\n"
17
-
18
- #: ../restrict-widgets.php:194
19
- msgid "Pages"
20
- msgstr "Strony"
21
-
22
- #: ../restrict-widgets.php:195
23
- msgid "Custom Post Types"
24
- msgstr "Własne typy wpisów"
25
-
26
- #: ../restrict-widgets.php:196
27
- msgid "Custom Post Type Archives"
28
- msgstr "Archiwa własnych typów wpisów"
29
-
30
- #: ../restrict-widgets.php:197
31
- msgid "Categories"
32
- msgstr "Kategorie"
33
-
34
- #: ../restrict-widgets.php:198
35
- msgid "Taxonomies"
36
- msgstr "Taksonomie"
37
-
38
- #: ../restrict-widgets.php:199
39
- msgid "Others"
40
- msgstr "Inne"
41
-
42
- #: ../restrict-widgets.php:200
43
- msgid "Users"
44
- msgstr "Użytkownicy"
45
-
46
- #: ../restrict-widgets.php:201
47
- msgid "Languages"
48
- msgstr "Języki"
49
-
50
- #: ../restrict-widgets.php:205
51
- msgid "Front Page"
52
- msgstr "Strona główna"
53
-
54
- #: ../restrict-widgets.php:206
55
- msgid "Blog Page"
56
- msgstr "Strona z wpisami"
57
-
58
- #: ../restrict-widgets.php:207
59
- msgid "Single Posts"
60
- msgstr "Pojedyncze wpisy"
61
-
62
- #: ../restrict-widgets.php:208
63
- msgid "Sticky Posts"
64
- msgstr "Wpisy przyklejone"
65
-
66
- #: ../restrict-widgets.php:209
67
- msgid "Author Archive"
68
- msgstr "Archiwum autora"
69
-
70
- #: ../restrict-widgets.php:210
71
- msgid "Date Archive"
72
- msgstr "Archiwum daty"
73
-
74
- #: ../restrict-widgets.php:211
75
- msgid "404 Page"
76
- msgstr "Strona błędów 404"
77
-
78
- #: ../restrict-widgets.php:212
79
- msgid "Search Page"
80
- msgstr "Strona wyszukiwania"
81
-
82
- #: ../restrict-widgets.php:216
83
- msgid "Logged in users"
84
- msgstr "Zalogowani użytkownicy"
85
-
86
- #: ../restrict-widgets.php:217
87
- msgid "Logged out users"
88
- msgstr "Wylogowani użytkownicy"
89
-
90
- #: ../restrict-widgets.php:447
91
- msgid "Restrict widgets"
92
- msgstr "Ograniczenia widgetów"
93
-
94
- #: ../restrict-widgets.php:451
95
- msgid ""
96
- "Use this settings to manage access to widgets page and to restrict "
97
- "availability of certain widgets, sidebars and widgets options to site "
98
- "administrators only."
99
- msgstr ""
100
- "Użyj tych ustawień aby określić kto może mieć dostęp do widgetów, jakie "
101
- "widgety, panele boczne i ustawienia widgetów są dostępne dla użytkowników a "
102
- "jakie tylko dla administratorów."
103
-
104
- #: ../restrict-widgets.php:454
105
- msgid "Restrict Users"
106
- msgstr "Ograniczenia użytkowników"
107
-
108
- #: ../restrict-widgets.php:464
109
- msgid "Select user roles restricted to manage widgets."
110
- msgstr "Wybierz role użytkowników, którzy mogą zarządzać widgetami."
111
-
112
- #: ../restrict-widgets.php:468
113
- msgid "Restrict Sidebars"
114
- msgstr "Ograniczenia paneli bocznych"
115
-
116
- #: ../restrict-widgets.php:483
117
- msgid "Select which sidebars will be restricted to admins only."
118
- msgstr "Wybierz panele boczne, które będą dostępne tylko dla administratorów."
119
-
120
- #: ../restrict-widgets.php:487
121
- msgid "Restrict Widgets"
122
- msgstr "Ograniczenia widgetów"
123
-
124
- #: ../restrict-widgets.php:499
125
- msgid "Select which widgets will be restricted to admins only."
126
- msgstr "Wybierz widgety, któe będą dostępne tylko dla administratorów."
127
-
128
- #: ../restrict-widgets.php:503
129
- msgid "Restrict Widget Options"
130
- msgstr "Ograniczenia opcji widgetów"
131
-
132
- #: ../restrict-widgets.php:513
133
- msgid "Select which widget options will be restricted to admins only."
134
- msgstr "Wybierz które opcje widgetów, będą dostępne tylko dla administratorów."
135
-
136
- #: ../restrict-widgets.php:517
137
- msgid "Restrict Option Groups"
138
- msgstr "Ograniczenia grup opcji"
139
-
140
- #: ../restrict-widgets.php:520
141
- msgid "Display widget options in groups"
142
- msgstr "Wyświetl opcje widgetów w grupach"
143
-
144
- #: ../restrict-widgets.php:524
145
- msgid "Plugin Deactivation"
146
- msgstr "Deaktywacja wtyczki"
147
-
148
- #: ../restrict-widgets.php:527
149
- msgid "Remove all plugin data on deactivation"
150
- msgstr "Usuń wszystkie dane wtyczki podczas deaktywacji"
151
-
152
- #: ../restrict-widgets.php:531
153
- msgid "Save settings"
154
- msgstr "Zapisz ustawienia"
155
-
156
- #: ../restrict-widgets.php:532
157
- msgid "Created by"
158
- msgstr "Stworzone przez"
159
-
160
- #: ../restrict-widgets.php:692 ../restrict-widgets.php:702
161
- #, php-format
162
- msgid "Single %s"
163
- msgstr "Pojedyncze %s"
164
-
165
- #: ../restrict-widgets.php:732 ../restrict-widgets.php:742
166
- #, php-format
167
- msgid "%s Archive"
168
- msgstr "Archiwum %s"
169
-
170
- #: ../restrict-widgets.php:970
171
- msgid "Display / Hide Widget"
172
- msgstr "Wyświetl / Ukryj widget"
173
-
174
- #: ../restrict-widgets.php:972
175
- msgid "Display widget on selected"
176
- msgstr "Wyświetl widget na wybranych stronach"
177
-
178
- #: ../restrict-widgets.php:973
179
- msgid "Hide widget on selected"
180
- msgstr "Ukryj widget na wybranych stronach"
181
-
182
- #: ../restrict-widgets.php:1259 ../restrict-widgets.php:1304
183
- msgid "Widgets"
184
- msgstr "Widgety"
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Restrict Widgets\n"
4
+ "POT-Creation-Date: 2013-04-12 15:03+0100\n"
5
+ "PO-Revision-Date: 2013-04-12 15:03+0100\n"
6
+ "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
+ "Language-Team: dFactory <info@dfactory.eu>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.5\n"
13
+ "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../restrict-widgets.php:103
19
+ msgid "Support"
20
+ msgstr "Forum pomocy"
21
+
22
+ #: ../restrict-widgets.php:118 ../restrict-widgets.php:1331
23
+ #: ../restrict-widgets.php:1376
24
+ msgid "Widgets"
25
+ msgstr "Widgety"
26
+
27
+ #: ../restrict-widgets.php:254
28
+ msgid "Pages"
29
+ msgstr "Strony"
30
+
31
+ #: ../restrict-widgets.php:255
32
+ msgid "Custom Post Types"
33
+ msgstr "Własne typy wpisów"
34
+
35
+ #: ../restrict-widgets.php:256
36
+ msgid "Custom Post Type Archives"
37
+ msgstr "Archiwa własnych typów wpisów"
38
+
39
+ #: ../restrict-widgets.php:257
40
+ msgid "Categories"
41
+ msgstr "Kategorie"
42
+
43
+ #: ../restrict-widgets.php:258
44
+ msgid "Taxonomies"
45
+ msgstr "Taksonomie"
46
+
47
+ #: ../restrict-widgets.php:259
48
+ msgid "Others"
49
+ msgstr "Inne"
50
+
51
+ #: ../restrict-widgets.php:260
52
+ msgid "Users"
53
+ msgstr "Użytkownicy"
54
+
55
+ #: ../restrict-widgets.php:261
56
+ msgid "Languages"
57
+ msgstr "Języki"
58
+
59
+ #: ../restrict-widgets.php:265
60
+ msgid "Front Page"
61
+ msgstr "Strona główna"
62
+
63
+ #: ../restrict-widgets.php:266
64
+ msgid "Blog Page"
65
+ msgstr "Strona z wpisami"
66
+
67
+ #: ../restrict-widgets.php:267
68
+ msgid "Single Posts"
69
+ msgstr "Pojedyncze wpisy"
70
+
71
+ #: ../restrict-widgets.php:268
72
+ msgid "Sticky Posts"
73
+ msgstr "Wpisy przyklejone"
74
+
75
+ #: ../restrict-widgets.php:269
76
+ msgid "Author Archive"
77
+ msgstr "Archiwum autora"
78
+
79
+ #: ../restrict-widgets.php:270
80
+ msgid "Date Archive"
81
+ msgstr "Archiwum daty"
82
+
83
+ #: ../restrict-widgets.php:271
84
+ msgid "404 Page"
85
+ msgstr "Strona błędów 404"
86
+
87
+ #: ../restrict-widgets.php:272
88
+ msgid "Search Page"
89
+ msgstr "Strona wyszukiwania"
90
+
91
+ #: ../restrict-widgets.php:276
92
+ msgid "Logged in users"
93
+ msgstr "Zalogowani użytkownicy"
94
+
95
+ #: ../restrict-widgets.php:277
96
+ msgid "Logged out users"
97
+ msgstr "Wylogowani użytkownicy"
98
+
99
+ #: ../restrict-widgets.php:498
100
+ msgid "Restrict widgets"
101
+ msgstr "Ograniczenia widgetów"
102
+
103
+ #: ../restrict-widgets.php:502
104
+ msgid ""
105
+ "Use this settings to manage access to widgets page and to restrict "
106
+ "availability of certain widgets, sidebars and widgets options to site "
107
+ "administrators only."
108
+ msgstr ""
109
+ "Użyj tych ustawień aby określić kto może mieć dostęp do widgetów, jakie "
110
+ "widgety, panele boczne i ustawienia widgetów są dostępne dla użytkowników a "
111
+ "jakie tylko dla administratorów."
112
+
113
+ #: ../restrict-widgets.php:505
114
+ msgid "Restrict Users"
115
+ msgstr "Ograniczenia użytkowników"
116
+
117
+ #: ../restrict-widgets.php:515
118
+ msgid "Select user roles restricted to manage widgets."
119
+ msgstr "Wybierz role użytkowników, którzy mogą zarządzać widgetami."
120
+
121
+ #: ../restrict-widgets.php:519
122
+ msgid "Restrict Sidebars"
123
+ msgstr "Ograniczenia paneli bocznych"
124
+
125
+ #: ../restrict-widgets.php:534
126
+ msgid "Select which sidebars will be restricted to admins only."
127
+ msgstr "Wybierz panele boczne, które będą dostępne tylko dla administratorów."
128
+
129
+ #: ../restrict-widgets.php:538
130
+ msgid "Restrict Widgets"
131
+ msgstr "Ograniczenia widgetów"
132
+
133
+ #: ../restrict-widgets.php:550
134
+ msgid "Select which widgets will be restricted to admins only."
135
+ msgstr "Wybierz widgety, któe będą dostępne tylko dla administratorów."
136
+
137
+ #: ../restrict-widgets.php:554
138
+ msgid "Restrict Widget Options"
139
+ msgstr "Ograniczenia opcji widgetów"
140
+
141
+ #: ../restrict-widgets.php:564
142
+ msgid "Select which widget options will be restricted to admins only."
143
+ msgstr "Wybierz które opcje widgetów, będą dostępne tylko dla administratorów."
144
+
145
+ #: ../restrict-widgets.php:568
146
+ msgid "Restrict Option Groups"
147
+ msgstr "Ograniczenia grup opcji"
148
+
149
+ #: ../restrict-widgets.php:571
150
+ msgid "Display widget options in groups"
151
+ msgstr "Wyświetl opcje widgetów w grupach"
152
+
153
+ #: ../restrict-widgets.php:575
154
+ msgid "Plugin Deactivation"
155
+ msgstr "Deaktywacja wtyczki"
156
+
157
+ #: ../restrict-widgets.php:578
158
+ msgid "Remove all plugin data on deactivation"
159
+ msgstr "Usuń wszystkie dane wtyczki podczas deaktywacji"
160
+
161
+ #: ../restrict-widgets.php:582
162
+ msgid "Save settings"
163
+ msgstr "Zapisz ustawienia"
164
+
165
+ #: ../restrict-widgets.php:583
166
+ msgid "Created by"
167
+ msgstr "Stworzone przez"
168
+
169
+ #: ../restrict-widgets.php:757 ../restrict-widgets.php:767
170
+ #, php-format
171
+ msgid "Single %s"
172
+ msgstr "Pojedyncze %s"
173
+
174
+ #: ../restrict-widgets.php:797 ../restrict-widgets.php:807
175
+ #, php-format
176
+ msgid "%s Archive"
177
+ msgstr "Archiwum %s"
178
+
179
+ #: ../restrict-widgets.php:1038
180
+ msgid "Display / Hide Widget"
181
+ msgstr "Wyświetl / Ukryj widget"
182
+
183
+ #: ../restrict-widgets.php:1040
184
+ msgid "Display widget on selected"
185
+ msgstr "Wyświetl widget na wybranych stronach"
186
+
187
+ #: ../restrict-widgets.php:1041
188
+ msgid "Hide widget on selected"
189
+ msgstr "Ukryj widget na wybranych stronach"
languages/restrict-widgets.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Restrict Widgets\n"
4
- "POT-Creation-Date: 2013-03-10 16:48+0100\n"
5
- "PO-Revision-Date: 2013-03-21 10:12+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: English\n"
@@ -15,141 +15,172 @@ msgstr ""
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-SearchPath-0: ..\n"
17
 
18
- #: ../restrict-widgets.php:46
 
 
 
 
 
 
 
 
 
19
  msgid "Pages"
20
  msgstr ""
21
 
22
- #: ../restrict-widgets.php:47
23
  msgid "Custom Post Types"
24
  msgstr ""
25
 
26
- #: ../restrict-widgets.php:48
27
  msgid "Custom Post Type Archives"
28
  msgstr ""
29
 
30
- #: ../restrict-widgets.php:49
31
  msgid "Categories"
32
  msgstr ""
33
 
34
- #: ../restrict-widgets.php:50
35
  msgid "Taxonomies"
36
  msgstr ""
37
 
38
- #: ../restrict-widgets.php:51
39
  msgid "Others"
40
  msgstr ""
41
 
42
- #: ../restrict-widgets.php:52
43
  msgid "Users"
44
  msgstr ""
45
 
46
- #: ../restrict-widgets.php:56
 
 
 
 
47
  msgid "Front Page"
48
  msgstr ""
49
 
50
- #: ../restrict-widgets.php:57
51
  msgid "Blog Page"
52
  msgstr ""
53
 
54
- #: ../restrict-widgets.php:58
55
- msgid "Single Post"
56
  msgstr ""
57
 
58
- #: ../restrict-widgets.php:59
59
- msgid "Sticky Post"
60
  msgstr ""
61
 
62
- #: ../restrict-widgets.php:60
63
  msgid "Author Archive"
64
  msgstr ""
65
 
66
- #: ../restrict-widgets.php:61
67
  msgid "Date Archive"
68
  msgstr ""
69
 
70
- #: ../restrict-widgets.php:62
71
  msgid "404 Page"
72
  msgstr ""
73
 
74
- #: ../restrict-widgets.php:63
75
  msgid "Search Page"
76
  msgstr ""
77
 
78
- #: ../restrict-widgets.php:67
79
  msgid "Logged in users"
80
  msgstr ""
81
 
82
- #: ../restrict-widgets.php:68
83
  msgid "Logged out users"
84
  msgstr ""
85
 
86
- #: ../restrict-widgets.php:300
87
  msgid "Restrict widgets"
88
  msgstr ""
89
 
90
- #: ../restrict-widgets.php:304
91
  msgid ""
92
  "Use this settings to manage access to widgets page and to restrict "
93
  "availability of certain widgets, sidebars and widgets options to site "
94
  "administrators only."
95
  msgstr ""
96
 
97
- #: ../restrict-widgets.php:311
98
  msgid "Restrict Users"
99
  msgstr ""
100
 
101
- #: ../restrict-widgets.php:320
102
  msgid "Select user roles restricted to manage widgets."
103
  msgstr ""
104
 
105
- #: ../restrict-widgets.php:323
106
  msgid "Restrict Sidebars"
107
  msgstr ""
108
 
109
- #: ../restrict-widgets.php:338
110
  msgid "Select which sidebars will be restricted to admins only."
111
  msgstr ""
112
 
113
- #: ../restrict-widgets.php:341
114
  msgid "Restrict Widgets"
115
  msgstr ""
116
 
117
- #: ../restrict-widgets.php:353
118
  msgid "Select which widgets will be restricted to admins only."
119
  msgstr ""
120
 
121
- #: ../restrict-widgets.php:356
122
- msgid "Restrict Widgets Options"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  msgstr ""
124
 
125
- #: ../restrict-widgets.php:365
126
- msgid "Select which widgets options will be restricted to admins only."
127
  msgstr ""
128
 
129
- #: ../restrict-widgets.php:367
130
  msgid "Save settings"
131
  msgstr ""
132
 
133
- #: ../restrict-widgets.php:464 ../restrict-widgets.php:474
134
- msgid "Single"
135
  msgstr ""
136
 
137
- #: ../restrict-widgets.php:498 ../restrict-widgets.php:508
138
- msgid "Archive"
 
139
  msgstr ""
140
 
141
- #: ../restrict-widgets.php:667
142
- msgid "Display / Hide Widget"
 
143
  msgstr ""
144
 
145
- #: ../restrict-widgets.php:669
146
- msgid "Display widget on selected"
147
  msgstr ""
148
 
149
- #: ../restrict-widgets.php:670
150
- msgid "Show widget on selected"
151
  msgstr ""
152
 
153
- #: ../restrict-widgets.php:950 ../restrict-widgets.php:988
154
- msgid "Widgets"
155
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Restrict Widgets\n"
4
+ "POT-Creation-Date: 2013-04-12 15:03+0100\n"
5
+ "PO-Revision-Date: 2013-04-12 15:03+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: English\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-SearchPath-0: ..\n"
17
 
18
+ #: ../restrict-widgets.php:103
19
+ msgid "Support"
20
+ msgstr ""
21
+
22
+ #: ../restrict-widgets.php:118 ../restrict-widgets.php:1331
23
+ #: ../restrict-widgets.php:1376
24
+ msgid "Widgets"
25
+ msgstr ""
26
+
27
+ #: ../restrict-widgets.php:254
28
  msgid "Pages"
29
  msgstr ""
30
 
31
+ #: ../restrict-widgets.php:255
32
  msgid "Custom Post Types"
33
  msgstr ""
34
 
35
+ #: ../restrict-widgets.php:256
36
  msgid "Custom Post Type Archives"
37
  msgstr ""
38
 
39
+ #: ../restrict-widgets.php:257
40
  msgid "Categories"
41
  msgstr ""
42
 
43
+ #: ../restrict-widgets.php:258
44
  msgid "Taxonomies"
45
  msgstr ""
46
 
47
+ #: ../restrict-widgets.php:259
48
  msgid "Others"
49
  msgstr ""
50
 
51
+ #: ../restrict-widgets.php:260
52
  msgid "Users"
53
  msgstr ""
54
 
55
+ #: ../restrict-widgets.php:261
56
+ msgid "Languages"
57
+ msgstr ""
58
+
59
+ #: ../restrict-widgets.php:265
60
  msgid "Front Page"
61
  msgstr ""
62
 
63
+ #: ../restrict-widgets.php:266
64
  msgid "Blog Page"
65
  msgstr ""
66
 
67
+ #: ../restrict-widgets.php:267
68
+ msgid "Single Posts"
69
  msgstr ""
70
 
71
+ #: ../restrict-widgets.php:268
72
+ msgid "Sticky Posts"
73
  msgstr ""
74
 
75
+ #: ../restrict-widgets.php:269
76
  msgid "Author Archive"
77
  msgstr ""
78
 
79
+ #: ../restrict-widgets.php:270
80
  msgid "Date Archive"
81
  msgstr ""
82
 
83
+ #: ../restrict-widgets.php:271
84
  msgid "404 Page"
85
  msgstr ""
86
 
87
+ #: ../restrict-widgets.php:272
88
  msgid "Search Page"
89
  msgstr ""
90
 
91
+ #: ../restrict-widgets.php:276
92
  msgid "Logged in users"
93
  msgstr ""
94
 
95
+ #: ../restrict-widgets.php:277
96
  msgid "Logged out users"
97
  msgstr ""
98
 
99
+ #: ../restrict-widgets.php:498
100
  msgid "Restrict widgets"
101
  msgstr ""
102
 
103
+ #: ../restrict-widgets.php:502
104
  msgid ""
105
  "Use this settings to manage access to widgets page and to restrict "
106
  "availability of certain widgets, sidebars and widgets options to site "
107
  "administrators only."
108
  msgstr ""
109
 
110
+ #: ../restrict-widgets.php:505
111
  msgid "Restrict Users"
112
  msgstr ""
113
 
114
+ #: ../restrict-widgets.php:515
115
  msgid "Select user roles restricted to manage widgets."
116
  msgstr ""
117
 
118
+ #: ../restrict-widgets.php:519
119
  msgid "Restrict Sidebars"
120
  msgstr ""
121
 
122
+ #: ../restrict-widgets.php:534
123
  msgid "Select which sidebars will be restricted to admins only."
124
  msgstr ""
125
 
126
+ #: ../restrict-widgets.php:538
127
  msgid "Restrict Widgets"
128
  msgstr ""
129
 
130
+ #: ../restrict-widgets.php:550
131
  msgid "Select which widgets will be restricted to admins only."
132
  msgstr ""
133
 
134
+ #: ../restrict-widgets.php:554
135
+ msgid "Restrict Widget Options"
136
+ msgstr ""
137
+
138
+ #: ../restrict-widgets.php:564
139
+ msgid "Select which widget options will be restricted to admins only."
140
+ msgstr ""
141
+
142
+ #: ../restrict-widgets.php:568
143
+ msgid "Restrict Option Groups"
144
+ msgstr ""
145
+
146
+ #: ../restrict-widgets.php:571
147
+ msgid "Display widget options in groups"
148
+ msgstr ""
149
+
150
+ #: ../restrict-widgets.php:575
151
+ msgid "Plugin Deactivation"
152
  msgstr ""
153
 
154
+ #: ../restrict-widgets.php:578
155
+ msgid "Remove all plugin data on deactivation"
156
  msgstr ""
157
 
158
+ #: ../restrict-widgets.php:582
159
  msgid "Save settings"
160
  msgstr ""
161
 
162
+ #: ../restrict-widgets.php:583
163
+ msgid "Created by"
164
  msgstr ""
165
 
166
+ #: ../restrict-widgets.php:757 ../restrict-widgets.php:767
167
+ #, php-format
168
+ msgid "Single %s"
169
  msgstr ""
170
 
171
+ #: ../restrict-widgets.php:797 ../restrict-widgets.php:807
172
+ #, php-format
173
+ msgid "%s Archive"
174
  msgstr ""
175
 
176
+ #: ../restrict-widgets.php:1038
177
+ msgid "Display / Hide Widget"
178
  msgstr ""
179
 
180
+ #: ../restrict-widgets.php:1040
181
+ msgid "Display widget on selected"
182
  msgstr ""
183
 
184
+ #: ../restrict-widgets.php:1041
185
+ msgid "Hide widget on selected"
186
  msgstr ""
readme.txt CHANGED
@@ -2,13 +2,13 @@
2
  Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: widget, widgets, widget-only, cms, conditional tags, conditional, widget logic, widget context, restrict, manage, management, capability, capabilities, sidebar, sidebars, user, permission, permissions
5
- Requires at least: 3.5
6
  Tested up to: 3.5.1
7
- Stable tag: 1.0.1.1
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
11
- Restrict Widgets allows you to easily hide or display widgets on specified pages.
12
 
13
  == Description ==
14
 
@@ -33,9 +33,9 @@ For more information, check out plugin page at [dFactory](http://www.dfactory.eu
33
 
34
  == Installation ==
35
 
36
- 1. Install Restrict Widgets either via the WordPress.org plugin directory, or by uploading the files to your server</li>
37
- 1. Activate the plugin through the 'Plugins' menu in WordPress</li>
38
- 1. Go to the Widgets menu and set your desired widgets options.</li>
39
 
40
  == Frequently Asked Questions ==
41
 
@@ -48,6 +48,12 @@ No questions yet.
48
 
49
  == Changelog ==
50
 
 
 
 
 
 
 
51
  = 1.0.1 =
52
  * Fix: Widget options not saving if no options selected
53
 
@@ -56,4 +62,5 @@ Initial release
56
 
57
  == Upgrade Notice ==
58
 
59
- The current version of Restrict Widgets requires WordPress 3.5 or higher. If you use older version of WordPress, you need to upgrade WordPress first.
 
2
  Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: widget, widgets, widget-only, cms, conditional tags, conditional, widget logic, widget context, restrict, manage, management, capability, capabilities, sidebar, sidebars, user, permission, permissions
5
+ Requires at least: 3.3
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.1.0
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
11
+ Restrict Widgets not only allows you to easily hide or display widgets on specified pages but gives you complete control over widgets and sidebars.
12
 
13
  == Description ==
14
 
33
 
34
  == Installation ==
35
 
36
+ 1. Install Restrict Widgets either via the WordPress.org plugin directory, or by uploading the files to your server
37
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
38
+ 1. Go to the Widgets menu and set your desired widgets options.
39
 
40
  == Frequently Asked Questions ==
41
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.1.0 =
52
+ * Fix: Show on selected not working in some cases
53
+ * Fix: Restricting on user_logged_in/out
54
+ * Fix: Restricting for Polylang and WPML languages
55
+ * New: Introducing filter rw_display_widget()
56
+
57
  = 1.0.1 =
58
  * Fix: Widget options not saving if no options selected
59
 
62
 
63
  == Upgrade Notice ==
64
 
65
+ = 1.1.0 =
66
+ Bugfixes for widget display and a new filter
restrict-widgets.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Restrict Widgets
4
  Description: Restrict Widgets allows you to hide or display widgets on specified pages.
5
- Version: 1.0.1.1
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/restrict-widgets/
@@ -20,7 +20,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
20
  */
21
 
22
 
23
- class RestrictWidgets
24
  {
25
  private $pages = array();
26
  private $custom_post_types = array();
@@ -46,7 +46,7 @@ class RestrictWidgets
46
  add_action('widgets_init', array(&$this, 'save_restrict_options'), 10);
47
  add_action('widgets_init', array(&$this, 'init_restrict_sidebars'), 11);
48
  add_action('sidebar_admin_page', array(&$this, 'add_widgets_options_box'));
49
- add_action('in_widget_form', array(&$this, 'display_admin_widgets_options'), 10, 3);
50
  add_action('admin_enqueue_scripts', array(&$this, 'widgets_scripts_styles'));
51
  add_action('admin_menu', array(&$this, 'manage_widgets_menu'));
52
 
@@ -54,7 +54,9 @@ class RestrictWidgets
54
  add_filter('widget_display_callback', array(&$this, 'display_frontend_widgets'));
55
  add_filter('widget_update_callback', array(&$this, 'update_admin_widgets_options'), 10, 3);
56
  add_filter('user_has_cap', array(&$this, 'manage_widgets_cap'), 10, 3);
57
- add_filter('dynamic_sidebar_params', array(&$this, 'restrict_sidebar_params'), 10, 3);
 
 
58
  }
59
 
60
 
@@ -76,12 +78,56 @@ class RestrictWidgets
76
 
77
 
78
  /**
79
- * Loads text domain
80
  */
81
  public function load_textdomain()
82
  {
83
  load_plugin_textdomain('restrict-widgets', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
84
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
 
87
  /**
@@ -575,7 +621,7 @@ class RestrictWidgets
575
 
576
  wp_enqueue_script(
577
  'restrict-widgets',
578
- plugins_url('js/restrict-widgets.js', __FILE__),
579
  array('jquery', 'chosen')
580
  );
581
 
@@ -646,7 +692,7 @@ class RestrictWidgets
646
  );
647
 
648
  wp_enqueue_style('chosen', plugins_url('css/chosen.css', __FILE__));
649
- wp_enqueue_style('style', plugins_url('css/style.css', __FILE__));
650
  }
651
 
652
 
@@ -1142,6 +1188,38 @@ class RestrictWidgets
1142
  }
1143
 
1144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1145
  /**
1146
  * Manages front-end display of widgets
1147
  */
@@ -1149,118 +1227,184 @@ class RestrictWidgets
1149
  {
1150
  global $wp_query;
1151
 
 
 
 
 
1152
  $post_id = $wp_query->get_queried_object_id();
 
1153
 
1154
- if(function_exists('icl_get_languages') || function_exists('pll_the_languages'))
1155
  {
1156
- $post_id = icl_object_id($post_id, 'page', FALSE);
1157
-
1158
- if(defined('ICL_LANGUAGE_CODE'))
1159
  {
1160
- $display = isset($instance['rw_opt']['language_'.ICL_LANGUAGE_CODE]) ? TRUE : FALSE;
1161
- }
 
1162
 
1163
- if(isset($instance['rw_opt']['widget_select']))
1164
- {
1165
- if (($instance['rw_opt']['widget_select'] === TRUE && $display === FALSE) || ($instance['rw_opt']['widget_select'] === FALSE && $display === TRUE))
1166
  {
1167
- return FALSE;
 
 
 
 
 
 
 
 
 
 
 
 
1168
  }
1169
  }
 
 
 
 
 
 
 
 
1170
  }
1171
 
1172
- if (isset($instance['rw_opt']['users_logged_in']) || isset($instance['rw_opt']['users_logged_out']))
1173
  {
1174
- if(is_user_logged_in())
1175
  {
1176
- $display = isset($instance['rw_opt']['users_logged_in']) ? TRUE : FALSE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1177
  }
1178
  else
1179
  {
1180
- $display = isset($instance['rw_opt']['users_logged_out']) ? TRUE : FALSE;
1181
- }
1182
- if(isset($instance['rw_opt']['widget_select']))
1183
- {
1184
- if (($instance['rw_opt']['widget_select'] === TRUE && $display === FALSE) || ($instance['rw_opt']['widget_select'] === FALSE && $display === TRUE))
1185
- {
1186
- return FALSE;
1187
- }
1188
  }
1189
  }
1190
 
1191
- if(is_front_page())
1192
  {
1193
- $display = isset($instance['rw_opt']['others_front_page']) ? TRUE : FALSE;
1194
-
1195
- if(is_home() && $display == FALSE)
1196
  {
1197
- $display = isset($instance['rw_opt']['others_blog_page']) ? TRUE : FALSE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198
  }
1199
- }
1200
- elseif(is_home())
1201
- {
1202
- $display = isset($instance['rw_opt']['others_blog_page']) ? TRUE : FALSE;
1203
- }
1204
- elseif(is_page())
1205
- {
1206
- $display = isset($instance['rw_opt']['pageid_'.$post_id]) ? TRUE : FALSE;
1207
- }
1208
- elseif(is_singular())
1209
- {
1210
- $display = isset($instance['rw_opt']['cpt_'.get_post_type($post_id)]) ? TRUE : FALSE;
1211
-
1212
- if(is_single() && $display == FALSE)
1213
  {
1214
- $display = isset($instance['rw_opt']['others_single_post']) ? TRUE : FALSE;
1215
  }
1216
  }
1217
- elseif(is_category())
1218
- {
1219
- $display = isset($instance['rw_opt']['category_'.get_query_var('cat')]) ? TRUE : FALSE;
1220
- }
1221
- elseif(is_tax())
1222
- {
1223
- $display = isset($instance['rw_opt']['taxonomy_'.get_query_var('taxonomy')]) ? TRUE : FALSE;
1224
- }
1225
- elseif(is_404())
1226
- {
1227
- $display = isset($instance['rw_opt']['others_404_page']) ? TRUE : FALSE;
1228
- }
1229
- elseif(is_sticky())
1230
- {
1231
- $display = isset($instance['rw_opt']['others_sticky_post']) ? TRUE : FALSE;
1232
- }
1233
- elseif(is_search())
1234
- {
1235
- $display = isset($instance['rw_opt']['others_search_page']) ? TRUE : FALSE;
1236
- }
1237
- elseif(is_author())
1238
- {
1239
- $display = isset($instance['rw_opt']['others_author_archive']) ? TRUE : FALSE;
1240
- }
1241
- elseif(is_date())
1242
- {
1243
- $display = isset($instance['rw_opt']['others_date_archive']) ? TRUE : FALSE;
1244
- }
1245
- elseif(is_post_type_archive())
1246
- {
1247
- $display = isset($instance['rw_opt']['cpta_'.get_post_type($post_id)]) ? TRUE : FALSE;
1248
- }
1249
 
1250
- if(!isset($display))
1251
  {
1252
- $display = FALSE;
1253
  }
1254
-
1255
- if(isset($instance['rw_opt']['widget_select']))
1256
  {
1257
- if (($instance['rw_opt']['widget_select'] === TRUE && $display === FALSE) || ($instance['rw_opt']['widget_select'] === FALSE && $display === TRUE))
1258
- {
1259
- return FALSE;
1260
- }
1261
  }
1262
 
1263
- return $instance;
 
1264
  }
1265
 
1266
 
@@ -1390,5 +1534,5 @@ class RestrictWidgets
1390
  }
1391
 
1392
 
1393
- $rw_in = new RestrictWidgets();
1394
  ?>
2
  /*
3
  Plugin Name: Restrict Widgets
4
  Description: Restrict Widgets allows you to hide or display widgets on specified pages.
5
+ Version: 1.1.0
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/restrict-widgets/
20
  */
21
 
22
 
23
+ class Restrict_Widgets
24
  {
25
  private $pages = array();
26
  private $custom_post_types = array();
46
  add_action('widgets_init', array(&$this, 'save_restrict_options'), 10);
47
  add_action('widgets_init', array(&$this, 'init_restrict_sidebars'), 11);
48
  add_action('sidebar_admin_page', array(&$this, 'add_widgets_options_box'));
49
+ add_action('in_widget_form', array(&$this, 'display_admin_widgets_options'), 99, 3);
50
  add_action('admin_enqueue_scripts', array(&$this, 'widgets_scripts_styles'));
51
  add_action('admin_menu', array(&$this, 'manage_widgets_menu'));
52
 
54
  add_filter('widget_display_callback', array(&$this, 'display_frontend_widgets'));
55
  add_filter('widget_update_callback', array(&$this, 'update_admin_widgets_options'), 10, 3);
56
  add_filter('user_has_cap', array(&$this, 'manage_widgets_cap'), 10, 3);
57
+ add_filter('dynamic_sidebar_params', array(&$this, 'restrict_sidebar_params'), 10, 3);
58
+ add_filter('plugin_row_meta', array(&$this, 'plugin_extend_links'), 10, 2);
59
+ add_filter('plugin_action_links', array(&$this, 'plugin_settings_link'), 10, 2);
60
  }
61
 
62
 
78
 
79
 
80
  /**
81
+ * Loads textdomain
82
  */
83
  public function load_textdomain()
84
  {
85
  load_plugin_textdomain('restrict-widgets', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
86
  }
87
+
88
+
89
+ /**
90
+ * Add links to Support Forum
91
+ */
92
+ public function plugin_extend_links($links, $file)
93
+ {
94
+ if (!current_user_can('install_plugins'))
95
+ return $links;
96
+
97
+ $plugin = plugin_basename(__FILE__);
98
+
99
+ if ($file == $plugin)
100
+ {
101
+ return array_merge(
102
+ $links,
103
+ array(sprintf('<a href="http://www.dfactory.eu/support/forum/restrict-widgets/" target="_blank">%s</a>', __('Support', 'restrict-widgets')))
104
+ );
105
+ }
106
+
107
+ return $links;
108
+ }
109
+
110
+
111
+ /**
112
+ * Add links to Settings page
113
+ */
114
+ function plugin_settings_link($links, $file)
115
+ {
116
+ if (!is_admin() || !current_user_can('edit_theme_options'))
117
+ return $links;
118
+
119
+ static $plugin;
120
+
121
+ $plugin = plugin_basename(__FILE__);
122
+
123
+ if ($file == $plugin)
124
+ {
125
+ $settings_link = sprintf('<a href="%s">%s</a>', admin_url('widgets.php'), __('Widgets', 'restrict-widgets'));
126
+ array_unshift($links, $settings_link);
127
+ }
128
+
129
+ return $links;
130
+ }
131
 
132
 
133
  /**
621
 
622
  wp_enqueue_script(
623
  'restrict-widgets',
624
+ plugins_url('js/restrict-widgets-admin.js', __FILE__),
625
  array('jquery', 'chosen')
626
  );
627
 
692
  );
693
 
694
  wp_enqueue_style('chosen', plugins_url('css/chosen.css', __FILE__));
695
+ wp_enqueue_style('style', plugins_url('css/restrict-widgets-admin.css', __FILE__));
696
  }
697
 
698
 
1188
  }
1189
 
1190
 
1191
+ private function is_widget_empty($widget, $type)
1192
+ {
1193
+ if(!empty($widget))
1194
+ {
1195
+ foreach($widget as $option => $bool)
1196
+ {
1197
+ $action = explode('_', $option, 2);
1198
+
1199
+ if($type === 'main')
1200
+ {
1201
+ $array = array('category', 'taxonomy', 'cpt', 'cpta', 'pageid', 'others');
1202
+ }
1203
+ elseif($type === 'lang')
1204
+ {
1205
+ $array = array('language');
1206
+ }
1207
+ elseif($type === 'user')
1208
+ {
1209
+ $array = array('users');
1210
+ }
1211
+
1212
+ if(in_array($action[0], $array))
1213
+ {
1214
+ return FALSE;
1215
+ }
1216
+ }
1217
+ }
1218
+
1219
+ return TRUE;
1220
+ }
1221
+
1222
+
1223
  /**
1224
  * Manages front-end display of widgets
1225
  */
1227
  {
1228
  global $wp_query;
1229
 
1230
+ $display_lang = $display_user = $display_main = '';
1231
+ $empty_lang = $empty_user = $empty_main = TRUE;
1232
+ $return = FALSE;
1233
+
1234
  $post_id = $wp_query->get_queried_object_id();
1235
+ $display_type = isset($instance['rw_opt']['widget_select']) ? $instance['rw_opt']['widget_select'] : FALSE;
1236
 
1237
+ if(isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'lang') === FALSE)
1238
  {
1239
+ if(function_exists('icl_get_languages') || function_exists('pll_the_languages'))
 
 
1240
  {
1241
+ $empty_lang = FALSE;
1242
+ $post_id = icl_object_id($post_id, 'page', FALSE);
1243
+ $found_lang = (defined('ICL_LANGUAGE_CODE') && isset($instance['rw_opt']['language_'.ICL_LANGUAGE_CODE]) ? TRUE : FALSE);
1244
 
1245
+ if($display_type === TRUE)
 
 
1246
  {
1247
+ if($found_lang === TRUE)
1248
+ {
1249
+ $display_lang = TRUE;
1250
+ }
1251
+ else
1252
+ {
1253
+ $return = TRUE;
1254
+ $display_lang = FALSE;
1255
+ }
1256
+ }
1257
+ else
1258
+ {
1259
+ $display_lang = ($found_lang === TRUE ? FALSE : TRUE);
1260
  }
1261
  }
1262
+ else
1263
+ {
1264
+ $display_lang = TRUE;
1265
+ }
1266
+ }
1267
+ else
1268
+ {
1269
+ $display_lang = TRUE;
1270
  }
1271
 
1272
+ if($return === FALSE)
1273
  {
1274
+ if(isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'user') === FALSE)
1275
  {
1276
+ $empty_user = FALSE;
1277
+
1278
+ if(is_user_logged_in())
1279
+ {
1280
+ if(isset($instance['rw_opt']['users_logged_in'], $instance['rw_opt']['users_logged_out']) || isset($instance['rw_opt']['users_logged_in']))
1281
+ {
1282
+ $found_user = TRUE;
1283
+ }
1284
+ elseif(isset($instance['rw_opt']['users_logged_out']))
1285
+ {
1286
+ $found_user = FALSE;
1287
+ }
1288
+ }
1289
+ else
1290
+ {
1291
+ if(isset($instance['rw_opt']['users_logged_out'], $instance['rw_opt']['users_logged_in']) || isset($instance['rw_opt']['users_logged_out']))
1292
+ {
1293
+ $found_user = TRUE;
1294
+ }
1295
+ elseif(isset($instance['rw_opt']['users_logged_in']))
1296
+ {
1297
+ $found_user = FALSE;
1298
+ }
1299
+ }
1300
+
1301
+ if($display_type === TRUE)
1302
+ {
1303
+ if($found_user === TRUE)
1304
+ {
1305
+ $display_user = TRUE;
1306
+ }
1307
+ else
1308
+ {
1309
+ $return = TRUE;
1310
+ $display_user = FALSE;
1311
+ }
1312
+ }
1313
+ else
1314
+ {
1315
+ $display_user = ($found_user === TRUE ? FALSE : TRUE);
1316
+ }
1317
  }
1318
  else
1319
  {
1320
+ $display_user = TRUE;
 
 
 
 
 
 
 
1321
  }
1322
  }
1323
 
1324
+ if($return === FALSE)
1325
  {
1326
+ if(isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'main') === FALSE)
 
 
1327
  {
1328
+ $empty_main = FALSE;
1329
+
1330
+ if(is_front_page())
1331
+ {
1332
+ $found_main = isset($instance['rw_opt']['others_front_page']) ? TRUE : FALSE;
1333
+
1334
+ if(is_home() && $found_main == FALSE)
1335
+ {
1336
+ $found_main = isset($instance['rw_opt']['others_blog_page']) ? TRUE : FALSE;
1337
+ }
1338
+ }
1339
+ elseif(is_home())
1340
+ {
1341
+ $found_main = isset($instance['rw_opt']['others_blog_page']) ? TRUE : FALSE;
1342
+ }
1343
+ elseif(is_page())
1344
+ {
1345
+ $found_main = isset($instance['rw_opt']['pageid_'.$post_id]) ? TRUE : FALSE;
1346
+ }
1347
+ elseif(is_singular())
1348
+ {
1349
+ $found_main = isset($instance['rw_opt']['cpt_'.get_post_type($post_id)]) ? TRUE : FALSE;
1350
+
1351
+ if(is_single() && $found_main == FALSE)
1352
+ {
1353
+ $found_main = isset($instance['rw_opt']['others_single_post']) ? TRUE : FALSE;
1354
+ }
1355
+ }
1356
+ elseif(is_category())
1357
+ {
1358
+ $found_main = isset($instance['rw_opt']['category_'.get_query_var('cat')]) ? TRUE : FALSE;
1359
+ }
1360
+ elseif(is_tax())
1361
+ {
1362
+ $found_main = isset($instance['rw_opt']['taxonomy_'.get_query_var('taxonomy')]) ? TRUE : FALSE;
1363
+ }
1364
+ elseif(is_404())
1365
+ {
1366
+ $found_main = isset($instance['rw_opt']['others_404_page']) ? TRUE : FALSE;
1367
+ }
1368
+ elseif(is_sticky())
1369
+ {
1370
+ $found_main = isset($instance['rw_opt']['others_sticky_post']) ? TRUE : FALSE;
1371
+ }
1372
+ elseif(is_search())
1373
+ {
1374
+ $found_main = isset($instance['rw_opt']['others_search_page']) ? TRUE : FALSE;
1375
+ }
1376
+ elseif(is_author())
1377
+ {
1378
+ $found_main = isset($instance['rw_opt']['others_author_archive']) ? TRUE : FALSE;
1379
+ }
1380
+ elseif(is_date())
1381
+ {
1382
+ $found_main = isset($instance['rw_opt']['others_date_archive']) ? TRUE : FALSE;
1383
+ }
1384
+ elseif(is_post_type_archive())
1385
+ {
1386
+ $found_main = isset($instance['rw_opt']['cpta_'.get_post_type($post_id)]) ? TRUE : FALSE;
1387
+ }
1388
+
1389
+ $display_main = ($display_type === TRUE ? ($found_main === TRUE ? TRUE : FALSE) : ($found_main === TRUE ? FALSE : TRUE));
1390
  }
1391
+ else
 
 
 
 
 
 
 
 
 
 
 
 
 
1392
  {
1393
+ $display_main = TRUE;
1394
  }
1395
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1396
 
1397
+ if($display_type === TRUE)
1398
  {
1399
+ $final_return = ($display_lang === TRUE && $display_user === TRUE && $display_main === TRUE ? $instance : FALSE);
1400
  }
1401
+ else
 
1402
  {
1403
+ $final_return = ((($empty_lang === FALSE && $empty_user === FALSE && $empty_main === FALSE && $display_lang === FALSE && $display_user === FALSE && $display_main === FALSE) || ($empty_lang === FALSE && $empty_user === FALSE && $display_lang === FALSE && $display_user === FALSE) || ($empty_lang === FALSE && $empty_main === FALSE && $display_lang === FALSE && $display_main === FALSE) || ($empty_user === FALSE && $empty_main === FALSE && $display_user === FALSE && $display_main === FALSE) || ($empty_lang === FALSE && $display_lang === FALSE) || ($empty_user === FALSE && $display_lang === FALSE) || ($empty_main === FALSE && $display_main === FALSE)) ? FALSE : $instance);
 
 
 
1404
  }
1405
 
1406
+ //display: return $instance, hide: return FALSE
1407
+ return apply_filters('rw_display_widget', $final_return);
1408
  }
1409
 
1410
 
1534
  }
1535
 
1536
 
1537
+ $restrict_widgets = new Restrict_Widgets();
1538
  ?>