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 | 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} +0 -0
- js/{restrict-widgets.js → restrict-widgets-admin.js} +0 -0
- languages/restrict-widgets-pl_PL.mo +0 -0
- languages/restrict-widgets-pl_PL.po +189 -184
- languages/restrict-widgets.pot +77 -46
- readme.txt +14 -7
- restrict-widgets.php +234 -90
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-
|
5 |
-
"PO-Revision-Date: 2013-
|
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:
|
19 |
-
msgid "
|
20 |
-
msgstr "
|
21 |
-
|
22 |
-
#: ../restrict-widgets.php:
|
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 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
msgid "
|
163 |
-
msgstr "
|
164 |
-
|
165 |
-
#: ../restrict-widgets.php:
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
msgid "
|
172 |
-
msgstr "
|
173 |
-
|
174 |
-
#: ../restrict-widgets.php:
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
|
|
|
|
|
|
|
|
|
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-
|
5 |
-
"PO-Revision-Date: 2013-
|
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
msgid "Pages"
|
20 |
msgstr ""
|
21 |
|
22 |
-
#: ../restrict-widgets.php:
|
23 |
msgid "Custom Post Types"
|
24 |
msgstr ""
|
25 |
|
26 |
-
#: ../restrict-widgets.php:
|
27 |
msgid "Custom Post Type Archives"
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: ../restrict-widgets.php:
|
31 |
msgid "Categories"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: ../restrict-widgets.php:
|
35 |
msgid "Taxonomies"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: ../restrict-widgets.php:
|
39 |
msgid "Others"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: ../restrict-widgets.php:
|
43 |
msgid "Users"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: ../restrict-widgets.php:
|
|
|
|
|
|
|
|
|
47 |
msgid "Front Page"
|
48 |
msgstr ""
|
49 |
|
50 |
-
#: ../restrict-widgets.php:
|
51 |
msgid "Blog Page"
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: ../restrict-widgets.php:
|
55 |
-
msgid "Single
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: ../restrict-widgets.php:
|
59 |
-
msgid "Sticky
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: ../restrict-widgets.php:
|
63 |
msgid "Author Archive"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: ../restrict-widgets.php:
|
67 |
msgid "Date Archive"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: ../restrict-widgets.php:
|
71 |
msgid "404 Page"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: ../restrict-widgets.php:
|
75 |
msgid "Search Page"
|
76 |
msgstr ""
|
77 |
|
78 |
-
#: ../restrict-widgets.php:
|
79 |
msgid "Logged in users"
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: ../restrict-widgets.php:
|
83 |
msgid "Logged out users"
|
84 |
msgstr ""
|
85 |
|
86 |
-
#: ../restrict-widgets.php:
|
87 |
msgid "Restrict widgets"
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: ../restrict-widgets.php:
|
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:
|
98 |
msgid "Restrict Users"
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: ../restrict-widgets.php:
|
102 |
msgid "Select user roles restricted to manage widgets."
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: ../restrict-widgets.php:
|
106 |
msgid "Restrict Sidebars"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: ../restrict-widgets.php:
|
110 |
msgid "Select which sidebars will be restricted to admins only."
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: ../restrict-widgets.php:
|
114 |
msgid "Restrict Widgets"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: ../restrict-widgets.php:
|
118 |
msgid "Select which widgets will be restricted to admins only."
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: ../restrict-widgets.php:
|
122 |
-
msgid "Restrict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: ../restrict-widgets.php:
|
126 |
-
msgid "
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: ../restrict-widgets.php:
|
130 |
msgid "Save settings"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: ../restrict-widgets.php:
|
134 |
-
msgid "
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: ../restrict-widgets.php:
|
138 |
-
|
|
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: ../restrict-widgets.php:
|
142 |
-
|
|
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: ../restrict-widgets.php:
|
146 |
-
msgid "Display
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: ../restrict-widgets.php:
|
150 |
-
msgid "
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: ../restrict-widgets.php:
|
154 |
-
msgid "
|
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.
|
6 |
Tested up to: 3.5.1
|
7 |
-
Stable tag: 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
|
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,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 |
-
|
|
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.
|
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
|
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'),
|
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
|
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/
|
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(
|
1155 |
{
|
1156 |
-
|
1157 |
-
|
1158 |
-
if(defined('ICL_LANGUAGE_CODE'))
|
1159 |
{
|
1160 |
-
$
|
1161 |
-
|
|
|
1162 |
|
1163 |
-
|
1164 |
-
{
|
1165 |
-
if (($instance['rw_opt']['widget_select'] === TRUE && $display === FALSE) || ($instance['rw_opt']['widget_select'] === FALSE && $display === TRUE))
|
1166 |
{
|
1167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1168 |
}
|
1169 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1170 |
}
|
1171 |
|
1172 |
-
if
|
1173 |
{
|
1174 |
-
if(
|
1175 |
{
|
1176 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1177 |
}
|
1178 |
else
|
1179 |
{
|
1180 |
-
$
|
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(
|
1192 |
{
|
1193 |
-
$
|
1194 |
-
|
1195 |
-
if(is_home() && $display == FALSE)
|
1196 |
{
|
1197 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
$
|
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(
|
1251 |
{
|
1252 |
-
$
|
1253 |
}
|
1254 |
-
|
1255 |
-
if(isset($instance['rw_opt']['widget_select']))
|
1256 |
{
|
1257 |
-
|
1258 |
-
{
|
1259 |
-
return FALSE;
|
1260 |
-
}
|
1261 |
}
|
1262 |
|
1263 |
-
return $instance
|
|
|
1264 |
}
|
1265 |
|
1266 |
|
@@ -1390,5 +1534,5 @@ class RestrictWidgets
|
|
1390 |
}
|
1391 |
|
1392 |
|
1393 |
-
$
|
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 |
?>
|