Version Description
- Fixed deprecated function errors
- Updated readme links
- Removed plugin activation redirect
- Fix capability for options page
- Remove deprecated screen_icon
- Fix options page help links
- Fix options std value missing error
A list of all changes can be found on Changelog page on Github
Download this release
Release Info
Developer | mattsay |
Plugin | Dropdown Menu Widget |
Version | 1.9.7 |
Comparing to | |
See all releases |
Code changes from version 1.9.6 to 1.9.7
- CHANGELOG.md +288 -279
- README.md +43 -43
- dropdown-menu-widget.pot +163 -163
- readme.txt +90 -83
- shailan-category-walker.php +91 -91
- shailan-dropdown-menu-options.php +335 -336
- shailan-multi-dropdown.php +197 -194
- shailan-page-walker.php +110 -110
- shailan.DropDownMenu.php +821 -829
- stf-page-options.php +185 -186
CHANGELOG.md
CHANGED
@@ -1,279 +1,288 @@
|
|
1 |
-
# Dropdown Menu Widget Changelog
|
2 |
-
|
3 |
-
This page lists all the major changes to the **Dropdown Menu Widget** for WordPress.
|
4 |
-
Please visit [Dropdown Menu Widget Homepage](http://metinsaylan.com/projects/wordpress/dropdown-menu-widget/) for more information.
|
5 |
-
|
6 |
-
### 1.9.
|
7 |
-
|
8 |
-
*
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
*
|
13 |
-
*
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
*
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
* Added:
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
*
|
27 |
-
*
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
* Added:
|
32 |
-
|
33 |
-
### 1.
|
34 |
-
|
35 |
-
*
|
36 |
-
*
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
*
|
41 |
-
|
42 |
-
### 1.
|
43 |
-
|
44 |
-
* Fixed:
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
*
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
*
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
*
|
63 |
-
* Added width option
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
*
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
*
|
73 |
-
|
74 |
-
### 1.6.
|
75 |
-
|
76 |
-
*
|
77 |
-
*
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
*
|
86 |
-
*
|
87 |
-
* Added
|
88 |
-
*
|
89 |
-
|
90 |
-
### 1.
|
91 |
-
|
92 |
-
* Added
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
*
|
97 |
-
*
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
* Fixed
|
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 |
-
* Fixed
|
149 |
-
*
|
150 |
-
*
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
*
|
156 |
-
* Removed
|
157 |
-
*
|
158 |
-
*
|
159 |
-
*
|
160 |
-
|
161 |
-
### 1.
|
162 |
-
|
163 |
-
*
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
* Added
|
168 |
-
*
|
169 |
-
|
170 |
-
### 1.
|
171 |
-
|
172 |
-
*
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
*
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
* Added
|
224 |
-
|
225 |
-
### 1.2.
|
226 |
-
|
227 |
-
* Fixed
|
228 |
-
|
229 |
-
### 1.2.
|
230 |
-
|
231 |
-
* Added
|
232 |
-
* Added
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
* Added
|
243 |
-
*
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
*
|
252 |
-
*
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
*
|
258 |
-
*
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
*
|
279 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Dropdown Menu Widget Changelog
|
2 |
+
|
3 |
+
This page lists all the major changes to the **Dropdown Menu Widget** for WordPress.
|
4 |
+
Please visit [Dropdown Menu Widget Homepage](http://metinsaylan.com/projects/wordpress/dropdown-menu-widget/) for more information.
|
5 |
+
|
6 |
+
### 1.9.6
|
7 |
+
|
8 |
+
* Fixed rename homepage problem
|
9 |
+
* Removed table wrapper around the menu, added a div instead
|
10 |
+
* Removed all unnecessary files (well nearly all)
|
11 |
+
* Removed tabs and simplified settings page for responsiveness
|
12 |
+
* Updated documentation links and descriptions
|
13 |
+
* Removed crappy widget footer links
|
14 |
+
|
15 |
+
### 1.9.3
|
16 |
+
|
17 |
+
* Updated WordPress version for compatibility.
|
18 |
+
|
19 |
+
### 1.9.2
|
20 |
+
|
21 |
+
* Added: Settings link on plugins page.
|
22 |
+
* Added: Plugin activation redirect to Settings page.
|
23 |
+
* Added: Filter wp_nav_menu arguments to create a dropdown menu. Theme can be changed via dropdown menu settings page.
|
24 |
+
* Added: Demo menu on settings page.
|
25 |
+
* Removed: Unnecessary scripts from scripts folder.
|
26 |
+
* Removed: Twitter box on settings page.
|
27 |
+
* Some minor fixes and tidy up on options page.
|
28 |
+
|
29 |
+
### 1.9.1
|
30 |
+
|
31 |
+
* Added: More detailed faq and plugin banner.
|
32 |
+
|
33 |
+
### 1.9
|
34 |
+
|
35 |
+
* Changed: Minimized included CSS file.
|
36 |
+
* Added: Support for changing arrow colors.
|
37 |
+
* Added: Help links next to options settings fields.
|
38 |
+
* Added: New Theme Rounded Corners.
|
39 |
+
* Added: New Theme Rounded Corners Light.
|
40 |
+
* Added: New Theme Pills.
|
41 |
+
|
42 |
+
### 1.8.1
|
43 |
+
|
44 |
+
* Fixed: HoverIntent hotfix for older version users. (Thanks to Karsten)
|
45 |
+
* Fixed: Various theme problems with vertical menus.
|
46 |
+
|
47 |
+
### 1.8
|
48 |
+
|
49 |
+
* Fixed: HoverIntent hotfix for Wordpress 3.3
|
50 |
+
|
51 |
+
### 1.7.2
|
52 |
+
|
53 |
+
* Fixed: Widget hotfix.
|
54 |
+
|
55 |
+
### 1.7.1
|
56 |
+
|
57 |
+
* Fixed: Template tag hotfix. Fixes displaying vertical instead of horizontal.
|
58 |
+
|
59 |
+
### 1.7
|
60 |
+
|
61 |
+
* Added: brand new options page.
|
62 |
+
* Added: Web2.0 Theme.
|
63 |
+
* Added: width option to widgets.
|
64 |
+
* Fixed: Right aligned menu dropdown errors.
|
65 |
+
* Added: Effect delay option (hoverIntent).
|
66 |
+
* Added: Plugin both search theme & template folders for dropdown.css
|
67 |
+
* Added: Adminbar button to easily change current options.
|
68 |
+
|
69 |
+
### 1.6.4
|
70 |
+
|
71 |
+
* Fixed effect selector error.
|
72 |
+
* Added width option for vertical menus.
|
73 |
+
|
74 |
+
### 1.6.3
|
75 |
+
|
76 |
+
* Fixed: Supplied arguments for the menu overwritten in the menu function.
|
77 |
+
* Added: Now you can easily add menus using menu names & ids and even locations.
|
78 |
+
|
79 |
+
### 1.6.2
|
80 |
+
|
81 |
+
* Fixed: Stylesheet causing widgets go behind widget containers. (Thanks to Antonio Capone for reporting the issue)
|
82 |
+
|
83 |
+
### 1.6.1
|
84 |
+
|
85 |
+
* Fix: Colorscheme background error.
|
86 |
+
* Fix: jQuery not included when effects are enabled.
|
87 |
+
* Added: Disabling options that are not used.
|
88 |
+
* Added: Custom Theme URL option.
|
89 |
+
|
90 |
+
### 1.6
|
91 |
+
|
92 |
+
* Added option to show title on widget.
|
93 |
+
* Added capability to find dropdown.css on your theme folder.
|
94 |
+
* Added jQuery dropdown effects.
|
95 |
+
* Added remove title attributes option.
|
96 |
+
* Added remove links from top level option.
|
97 |
+
* Many more to come..
|
98 |
+
|
99 |
+
### 1.5.8
|
100 |
+
|
101 |
+
* Added dropdown_menu_defaults filter for changing default options like order, depth etc.
|
102 |
+
|
103 |
+
### 1.5.7
|
104 |
+
|
105 |
+
* Fixed various css issues.
|
106 |
+
* Removed backgrounds for IE on certain themes.
|
107 |
+
* Hopefully works with all browsers with javascript enabled (Tested with Chrome, Firefox, Safari, Opera and IE6).
|
108 |
+
* Please submit any bugs you see on [dropdown menu plugin page](http://shailan.com/wordpress/plugins/dropdown-menu/)
|
109 |
+
|
110 |
+
### 1.5.6beta
|
111 |
+
|
112 |
+
* Added hooks for inserting your own menu & other navigational elements.
|
113 |
+
* Fixed z-index errors.
|
114 |
+
* Fixed background problem with custom theme selection.
|
115 |
+
* Added "include archives" option to Dropdown-Multi widget.
|
116 |
+
|
117 |
+
### 1.5.6alpha1
|
118 |
+
|
119 |
+
* Fixed sub menu display errors.
|
120 |
+
* Added alignment option to template tag support.
|
121 |
+
|
122 |
+
### 1.5.6alpha
|
123 |
+
|
124 |
+
* Fixed options page saving error.
|
125 |
+
* Added a brand new color selection interface for custom "Color Scheme" (beta).
|
126 |
+
* Now you can easily select your own colors & plus overlays!
|
127 |
+
|
128 |
+
### 1.5.5
|
129 |
+
|
130 |
+
* New theme! Hulu style theme.
|
131 |
+
* Added new action hooks to insert your items to the dropdown menu.
|
132 |
+
|
133 |
+
### 1.5.4
|
134 |
+
|
135 |
+
* Added first-child & last-child selector for styling to dropdown menu. (available when jquery is active only)
|
136 |
+
* Fixed IE display errors for shiny black theme.
|
137 |
+
* Fixed not saving issues with the plugin options.
|
138 |
+
|
139 |
+
### 1.5.3
|
140 |
+
|
141 |
+
* Made Custom CSS area available even when a theme is selected. You can now use this area for your theme customizations.
|
142 |
+
* Fixed `Call undefined function wp_nav_menu on 365` error.
|
143 |
+
* Fixed font-size problems with `Shiny Black` theme.
|
144 |
+
* Removed behaviour fix for IE. Now using only jquery as dropdown fix which comes packed with wordpress.
|
145 |
+
|
146 |
+
### 1.5.2
|
147 |
+
|
148 |
+
* Fixed tested version number.
|
149 |
+
* Added screenshot 2.
|
150 |
+
* Added options page screenshot.
|
151 |
+
* Now plugin allows you to rename the home link.
|
152 |
+
|
153 |
+
### 1.5.1
|
154 |
+
|
155 |
+
* Removed custom walker support for now.
|
156 |
+
* Removed blue tabs theme since it was using custom walkers.
|
157 |
+
* Fixed all the styles to work with new css classes.
|
158 |
+
* Updated Shiny Black theme to work with wide links.
|
159 |
+
* Complete support for custom css insert.
|
160 |
+
|
161 |
+
### 1.5
|
162 |
+
|
163 |
+
* Fixed issues with wordpress 3.0.
|
164 |
+
* Renamed plugin to dropdown menu.
|
165 |
+
* Removed inline style option.
|
166 |
+
* Removed unnecessary screenshots.
|
167 |
+
* Added support for wordpress 3.0 navigation menus.
|
168 |
+
* Removed exclude pages plugin.
|
169 |
+
|
170 |
+
### 1.4.1
|
171 |
+
|
172 |
+
* A minor fix for `Parse error: parse error, expecting 'T_FUNCTION' in C:\wamp\www\wordpress\wp-content\plugins\dropdown-menu-widget\shailan-multi-dropdown.php on line 194` error.
|
173 |
+
|
174 |
+
### 1.4.0
|
175 |
+
|
176 |
+
* Added option for multiline links. If checked a link with more than one word will be wrapped.
|
177 |
+
* Another fix for IE. Hopefully last.
|
178 |
+
|
179 |
+
### 1.3.9
|
180 |
+
|
181 |
+
* Fixed errors for IE jquery support.
|
182 |
+
* Added belorussian translation provided by [Marcis G.](http://pc.de)
|
183 |
+
* Added lang folder for translations.
|
184 |
+
|
185 |
+
### 1.3.8
|
186 |
+
|
187 |
+
* Added option for displaying title attributes. You may now turn title display on from the Settings page.
|
188 |
+
|
189 |
+
### 1.3.7
|
190 |
+
|
191 |
+
* Removed unnecessary extrude line from Dropdown Multi widget.
|
192 |
+
|
193 |
+
### 1.3.6
|
194 |
+
|
195 |
+
* Fixed "Dropdown Multi" widget error with categories and links.
|
196 |
+
|
197 |
+
### 1.3.5
|
198 |
+
|
199 |
+
* Added "Dropdown Multi" widget that allows you to inlude pages, categories and links in one menu.
|
200 |
+
|
201 |
+
### 1.3.4
|
202 |
+
|
203 |
+
* Fixed dropdown errors for IE7. Report any bugs with a screenshot please. Thanks.
|
204 |
+
|
205 |
+
### 1.3.3
|
206 |
+
|
207 |
+
* Fixed function name collisions with "Exclude Pages" plugin. The plugin is fully functional now.
|
208 |
+
|
209 |
+
### 1.3.2
|
210 |
+
|
211 |
+
* Bundled with "Exclude Pages" plugin by [Simon Wheatley](http://simonwheatley.co.uk/wordpress/). You can now easily exclude pages from the navigation. Just uncheck the the "Include page in menus" checkbox on the page edit screen. See [screenshots](http://wordpress.org/extend/plugins/dropdown-menu-widget/screenshots/) for more information.
|
212 |
+
|
213 |
+
### 1.3.1
|
214 |
+
|
215 |
+
* Added "Blue gradient" theme.
|
216 |
+
|
217 |
+
### 1.3.0
|
218 |
+
|
219 |
+
* Fixed "Home" link bug for the template tag. Thanks to Jeff.
|
220 |
+
|
221 |
+
### 1.2.7
|
222 |
+
|
223 |
+
* Added "include homepage link" for both pages and categories now. You can enable/disable this link from the widget options easily.
|
224 |
+
|
225 |
+
### 1.2.6
|
226 |
+
|
227 |
+
* Fixed a minor bug.
|
228 |
+
|
229 |
+
### 1.2.5
|
230 |
+
|
231 |
+
* Added translation support.
|
232 |
+
* Added pot file for translators.
|
233 |
+
|
234 |
+
### 1.2.4
|
235 |
+
|
236 |
+
* Fixed category walker for the advanced styling.
|
237 |
+
|
238 |
+
### 1.2.3
|
239 |
+
|
240 |
+
* Added Aqua theme.
|
241 |
+
* Added <span> elements in the menu so more advanced styling can be made.
|
242 |
+
* Added alignment option. Now you can align your menu wherever you wanted!
|
243 |
+
* Added Shiny Black theme.
|
244 |
+
|
245 |
+
### 1.2.0
|
246 |
+
|
247 |
+
* Removed title attributes for the categories dropdown menu items.
|
248 |
+
|
249 |
+
### 1.1.0
|
250 |
+
|
251 |
+
* Added custom walker class to disable title attributes on menu items.
|
252 |
+
* Renamed class and style files.
|
253 |
+
* Fixed default theme.
|
254 |
+
|
255 |
+
### 1.0.0
|
256 |
+
|
257 |
+
* Added vertical dropdown menu functionality.
|
258 |
+
* Fixed widget code.
|
259 |
+
* Changed dropdown widget classname to : shailan-dropdown-menu
|
260 |
+
* Changed wrapper div classname to : shailan-dropdown-wrapper
|
261 |
+
* Moved li item paddings to anchor elements.
|
262 |
+
|
263 |
+
### 0.4.3
|
264 |
+
|
265 |
+
* New grayscale theme.
|
266 |
+
* Template tag `shailan_dropdown_menu()` is available now. See usage for more info.
|
267 |
+
* Template tag options added.
|
268 |
+
|
269 |
+
### 0.4.2
|
270 |
+
|
271 |
+
* Fixed XHTML error on link tags.
|
272 |
+
* Fixed Inline Style error on categories dropdown menu.
|
273 |
+
* Removed unnecessary files.
|
274 |
+
|
275 |
+
### 0.4.1
|
276 |
+
|
277 |
+
* Fixed XHTML issues.
|
278 |
+
* Added WP Default theme.
|
279 |
+
* Made some minor fixes to widget options form.
|
280 |
+
|
281 |
+
### 0.3
|
282 |
+
|
283 |
+
* Fixed problems about styling. Now you can change dropdown menu style from the options page.
|
284 |
+
|
285 |
+
### 0.2
|
286 |
+
|
287 |
+
* First public release.
|
288 |
+
* Added login and register button options.
|
README.md
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
# Dropdown Menu Widget
|
2 |
-
|
3 |
-
*Simple Pages/Categories/Custom dropdown navigation menus with nice jQuery effects. Comes with various customizable CSS themes!*
|
4 |
-
|
5 |
-
## Description
|
6 |
-
|
7 |
-
**Dropdown Menu widget** adds a beautiful dropdown menu, listing pages and categories of your blog. You can also turn your WordPress navigation menus into beautiful dropdown menus using this plugin.
|
8 |
-
|
9 |
-
### Main Features:
|
10 |
-
|
11 |
-
* Automatically generated menus
|
12 |
-
* Supports pages, categories and custom menus
|
13 |
-
* jQuery Effects (must be enabled from panel)
|
14 |
-
* Customizable color scheme (select Custom Theme from options to activate)
|
15 |
-
* Vertical or Horizontal Menus
|
16 |
-
* Supports Multiple Instances
|
17 |
-
* Can be embedded into theme using [PHP Template Tag](
|
18 |
-
|
19 |
-
### Documentation & Simple Tutorials
|
20 |
-
|
21 |
-
* [Dropdown Menu Widget Help](
|
22 |
-
* [Dropdown Menu PHP Template Tag Usage](
|
23 |
-
* [Using Custom Menus In Dropdown Menu Widget](
|
24 |
-
* [Tutorial: Create your very own dropdown menu stylesheet](
|
25 |
-
* [Hook: Append Categories Menu To Pages Menu](
|
26 |
-
* [View all posts tagged `Dropdown Menu Widget`](
|
27 |
-
|
28 |
-
If you like this plugin, please [donate](
|
29 |
-
|
30 |
-
Please report issues on [Github Issues Page](https://github.com/shailancom/dropdown-menu-widget/issues).
|
31 |
-
Visit source on [github](https://github.com/shailancom/dropdown-menu-widget)
|
32 |
-
|
33 |
-
## Installation
|
34 |
-
|
35 |
-
Dropdown menu widget is so easy to setup. Just follow the steps below to add it to your site.
|
36 |
-
|
37 |
-
1. Login to your WordPress dashboard and go to Plugins > Add New.
|
38 |
-
2. If you have downloaded the plugin, click on `Upload` link and upload the plugin.
|
39 |
-
3. If you haven't downloaded yet, type `dropdown menu widget` to search field and click `Search`.
|
40 |
-
4. Click on `Install` and click `Activate plugin` once it is loaded.
|
41 |
-
5. Go to `Dropdown menu settings` under `Settings` to change dropdown theme and edit your settings.
|
42 |
-
6. Add the dropdown menu to your site using `Widgets` or template tag codes.
|
43 |
-
7. Done. Enjoy!
|
1 |
+
# Dropdown Menu Widget
|
2 |
+
|
3 |
+
*Simple Pages/Categories/Custom dropdown navigation menus with nice jQuery effects. Comes with various customizable CSS themes!*
|
4 |
+
|
5 |
+
## Description
|
6 |
+
|
7 |
+
**Dropdown Menu widget** adds a beautiful dropdown menu, listing pages and categories of your blog. You can also turn your WordPress navigation menus into beautiful dropdown menus using this plugin.
|
8 |
+
|
9 |
+
### Main Features:
|
10 |
+
|
11 |
+
* Automatically generated menus
|
12 |
+
* Supports pages, categories and custom menus
|
13 |
+
* jQuery Effects (must be enabled from panel)
|
14 |
+
* Customizable color scheme (select Custom Theme from options to activate)
|
15 |
+
* Vertical or Horizontal Menus
|
16 |
+
* Supports Multiple Instances
|
17 |
+
* Can be embedded into theme using [PHP Template Tag](https://metinsaylan.com/4598/dropdown-menu-widget-template-tag-usage-explained/)
|
18 |
+
|
19 |
+
### Documentation & Simple Tutorials
|
20 |
+
|
21 |
+
* [Dropdown Menu Widget Help](https://metinsaylan.com/wordpress/plugins/dropdown-menu/help/)
|
22 |
+
* [Dropdown Menu PHP Template Tag Usage](https://metinsaylan.com/4598/dropdown-menu-widget-template-tag-usage-explained/)
|
23 |
+
* [Using Custom Menus In Dropdown Menu Widget](https://metinsaylan.com/1025/custom-dropdown-menu-using-wordpress-3-nav-menus/)
|
24 |
+
* [Tutorial: Create your very own dropdown menu stylesheet](https://metinsaylan.com/600/tutorial-create-your-very-own-dropdown-menu-stylesheet/)
|
25 |
+
* [Hook: Append Categories Menu To Pages Menu](https://metinsaylan.com/4570/how-to-add-categories-dropdown-to-the-end-of-dropdown-menu-widget/)
|
26 |
+
* [View all posts tagged `Dropdown Menu Widget`](https://metinsaylan.com/tag/dropdown-menu-widget/)
|
27 |
+
|
28 |
+
If you like this plugin, please [donate](https://metinsaylan.com/donate/).
|
29 |
+
|
30 |
+
Please report issues on [Github Issues Page](https://github.com/shailancom/dropdown-menu-widget/issues).
|
31 |
+
Visit source on [github](https://github.com/shailancom/dropdown-menu-widget)
|
32 |
+
|
33 |
+
## Installation
|
34 |
+
|
35 |
+
Dropdown menu widget is so easy to setup. Just follow the steps below to add it to your site.
|
36 |
+
|
37 |
+
1. Login to your WordPress dashboard and go to Plugins > Add New.
|
38 |
+
2. If you have downloaded the plugin, click on `Upload` link and upload the plugin.
|
39 |
+
3. If you haven't downloaded yet, type `dropdown menu widget` to search field and click `Search`.
|
40 |
+
4. Click on `Install` and click `Activate plugin` once it is loaded.
|
41 |
+
5. Go to `Dropdown menu settings` under `Settings` to change dropdown theme and edit your settings.
|
42 |
+
6. Add the dropdown menu to your site using `Widgets` or template tag codes.
|
43 |
+
7. Done. Enjoy!
|
dropdown-menu-widget.pot
CHANGED
@@ -1,163 +1,163 @@
|
|
1 |
-
# Translation of the WordPress plugin by .
|
2 |
-
# Copyright (C) 2009
|
3 |
-
# This file is distributed under the same license as the package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
5 |
-
#
|
6 |
-
#, fuzzy
|
7 |
-
msgid ""
|
8 |
-
msgstr ""
|
9 |
-
"Project-Id-Version: \n"
|
10 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/dropdown-menu-widget\n"
|
11 |
-
"POT-Creation-Date: 2009-12-31 09:25+0000\n"
|
12 |
-
"PO-Revision-Date: 2009-MO-DA HO:MI+ZONE\n"
|
13 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
-
"MIME-Version: 1.0\n"
|
16 |
-
"Content-Type: text/plain; charset=utf-8\n"
|
17 |
-
"Content-Transfer-Encoding: 8bit\n"
|
18 |
-
|
19 |
-
#: shailan-category-walker.php:95
|
20 |
-
#, php-format
|
21 |
-
msgid "Feed for all posts filed under %s"
|
22 |
-
msgstr ""
|
23 |
-
|
24 |
-
#: shailan.DropDownMenu.php:22
|
25 |
-
msgid "Dropdown page/category menu"
|
26 |
-
msgstr ""
|
27 |
-
|
28 |
-
#: shailan.DropDownMenu.php:23 shailan.DropDownMenu.php:33
|
29 |
-
msgid "Dropdown Menu"
|
30 |
-
msgstr ""
|
31 |
-
|
32 |
-
#: shailan.DropDownMenu.php:33
|
33 |
-
msgid "Settings for Dropdown Menu"
|
34 |
-
msgstr ""
|
35 |
-
|
36 |
-
#: shailan.DropDownMenu.php:82
|
37 |
-
msgid "Options saved."
|
38 |
-
msgstr ""
|
39 |
-
|
40 |
-
#: shailan.DropDownMenu.php:116
|
41 |
-
msgid ""
|
42 |
-
"Dropdown menu creates a beautiful CSS only dropdown menu from your wordpress "
|
43 |
-
"pages or categories. You can customize dropdown menu theme and settings here:"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#: shailan.DropDownMenu.php:124
|
47 |
-
msgid "Dropdown menu theme"
|
48 |
-
msgstr ""
|
49 |
-
|
50 |
-
#: shailan.DropDownMenu.php:132
|
51 |
-
msgid "You can choose a theme for your dropdown menu here."
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: shailan.DropDownMenu.php:137
|
55 |
-
msgid "Template tag options"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: shailan.DropDownMenu.php:138
|
59 |
-
msgid ""
|
60 |
-
"You can use following template tag in your themes to display the dropdown "
|
61 |
-
"menu."
|
62 |
-
msgstr ""
|
63 |
-
|
64 |
-
#: shailan.DropDownMenu.php:140
|
65 |
-
msgid "Here you can set template tag options:"
|
66 |
-
msgstr ""
|
67 |
-
|
68 |
-
#: shailan.DropDownMenu.php:143 shailan.DropDownMenu.php:269
|
69 |
-
msgid "Title (won't be shown):"
|
70 |
-
msgstr ""
|
71 |
-
|
72 |
-
#: shailan.DropDownMenu.php:145 shailan.DropDownMenu.php:271
|
73 |
-
msgid "Type:"
|
74 |
-
msgstr ""
|
75 |
-
|
76 |
-
#: shailan.DropDownMenu.php:145 shailan.DropDownMenu.php:271
|
77 |
-
msgid "Pages"
|
78 |
-
msgstr ""
|
79 |
-
|
80 |
-
#: shailan.DropDownMenu.php:145 shailan.DropDownMenu.php:271
|
81 |
-
msgid "Categories"
|
82 |
-
msgstr ""
|
83 |
-
|
84 |
-
#: shailan.DropDownMenu.php:147 shailan.DropDownMenu.php:273
|
85 |
-
msgid "Exclude:"
|
86 |
-
msgstr ""
|
87 |
-
|
88 |
-
#: shailan.DropDownMenu.php:148
|
89 |
-
msgid "Page IDs, separated by commas."
|
90 |
-
msgstr ""
|
91 |
-
|
92 |
-
#: shailan.DropDownMenu.php:152 shailan.DropDownMenu.php:278
|
93 |
-
msgid "Add login/logout"
|
94 |
-
msgstr ""
|
95 |
-
|
96 |
-
#: shailan.DropDownMenu.php:154 shailan.DropDownMenu.php:280
|
97 |
-
msgid "Add Register/Site Admin"
|
98 |
-
msgstr ""
|
99 |
-
|
100 |
-
#: shailan.DropDownMenu.php:156 shailan.DropDownMenu.php:282
|
101 |
-
msgid "Vertical menu"
|
102 |
-
msgstr ""
|
103 |
-
|
104 |
-
#: shailan.DropDownMenu.php:159 shailan.DropDownMenu.php:287
|
105 |
-
msgid "Inline Style:"
|
106 |
-
msgstr ""
|
107 |
-
|
108 |
-
#: shailan.DropDownMenu.php:160
|
109 |
-
msgid "Applied to menu container <div>"
|
110 |
-
msgstr ""
|
111 |
-
|
112 |
-
#: shailan.DropDownMenu.php:162
|
113 |
-
msgid ""
|
114 |
-
"NOTE: Widgets have their own options. Those options won't affect widgets."
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
#: shailan.DropDownMenu.php:166
|
118 |
-
msgid ""
|
119 |
-
"NOTE : Onscreen theme edit will be available soon. Be sure to check <a href="
|
120 |
-
"\"http://shailan.com\">shailan.com</a> regularly for updates."
|
121 |
-
msgstr ""
|
122 |
-
|
123 |
-
#: shailan.DropDownMenu.php:169
|
124 |
-
msgid "Save Changes"
|
125 |
-
msgstr ""
|
126 |
-
|
127 |
-
#: shailan.DropDownMenu.php:171
|
128 |
-
msgid ""
|
129 |
-
"Visit <a href=\"http://shailan.com\">shailan.com</a> for more wordpress "
|
130 |
-
"themes, plugins and widgets."
|
131 |
-
msgstr ""
|
132 |
-
|
133 |
-
#: shailan.DropDownMenu.php:222
|
134 |
-
msgid "Home"
|
135 |
-
msgstr ""
|
136 |
-
|
137 |
-
#: shailan.DropDownMenu.php:285
|
138 |
-
msgid "Align:"
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
#: shailan.DropDownMenu.php:285
|
142 |
-
msgid "Left"
|
143 |
-
msgstr ""
|
144 |
-
|
145 |
-
#: shailan.DropDownMenu.php:285
|
146 |
-
msgid "Center"
|
147 |
-
msgstr ""
|
148 |
-
|
149 |
-
#: shailan.DropDownMenu.php:285
|
150 |
-
msgid "Right"
|
151 |
-
msgstr ""
|
152 |
-
|
153 |
-
#: shailan.DropDownMenu.php:288
|
154 |
-
msgid "Applied to menu container <div>."
|
155 |
-
msgstr ""
|
156 |
-
|
157 |
-
#: shailan.DropDownMenu.php:291
|
158 |
-
msgid "Menu Style"
|
159 |
-
msgstr ""
|
160 |
-
|
161 |
-
#: shailan.DropDownMenu.php:291
|
162 |
-
msgid "Visit plugin site"
|
163 |
-
msgstr ""
|
1 |
+
# Translation of the WordPress plugin by .
|
2 |
+
# Copyright (C) 2009
|
3 |
+
# This file is distributed under the same license as the package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
5 |
+
#
|
6 |
+
#, fuzzy
|
7 |
+
msgid ""
|
8 |
+
msgstr ""
|
9 |
+
"Project-Id-Version: \n"
|
10 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/dropdown-menu-widget\n"
|
11 |
+
"POT-Creation-Date: 2009-12-31 09:25+0000\n"
|
12 |
+
"PO-Revision-Date: 2009-MO-DA HO:MI+ZONE\n"
|
13 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
+
"MIME-Version: 1.0\n"
|
16 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
17 |
+
"Content-Transfer-Encoding: 8bit\n"
|
18 |
+
|
19 |
+
#: shailan-category-walker.php:95
|
20 |
+
#, php-format
|
21 |
+
msgid "Feed for all posts filed under %s"
|
22 |
+
msgstr ""
|
23 |
+
|
24 |
+
#: shailan.DropDownMenu.php:22
|
25 |
+
msgid "Dropdown page/category menu"
|
26 |
+
msgstr ""
|
27 |
+
|
28 |
+
#: shailan.DropDownMenu.php:23 shailan.DropDownMenu.php:33
|
29 |
+
msgid "Dropdown Menu"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: shailan.DropDownMenu.php:33
|
33 |
+
msgid "Settings for Dropdown Menu"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
+
#: shailan.DropDownMenu.php:82
|
37 |
+
msgid "Options saved."
|
38 |
+
msgstr ""
|
39 |
+
|
40 |
+
#: shailan.DropDownMenu.php:116
|
41 |
+
msgid ""
|
42 |
+
"Dropdown menu creates a beautiful CSS only dropdown menu from your wordpress "
|
43 |
+
"pages or categories. You can customize dropdown menu theme and settings here:"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: shailan.DropDownMenu.php:124
|
47 |
+
msgid "Dropdown menu theme"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: shailan.DropDownMenu.php:132
|
51 |
+
msgid "You can choose a theme for your dropdown menu here."
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: shailan.DropDownMenu.php:137
|
55 |
+
msgid "Template tag options"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: shailan.DropDownMenu.php:138
|
59 |
+
msgid ""
|
60 |
+
"You can use following template tag in your themes to display the dropdown "
|
61 |
+
"menu."
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
+
#: shailan.DropDownMenu.php:140
|
65 |
+
msgid "Here you can set template tag options:"
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
#: shailan.DropDownMenu.php:143 shailan.DropDownMenu.php:269
|
69 |
+
msgid "Title (won't be shown):"
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: shailan.DropDownMenu.php:145 shailan.DropDownMenu.php:271
|
73 |
+
msgid "Type:"
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: shailan.DropDownMenu.php:145 shailan.DropDownMenu.php:271
|
77 |
+
msgid "Pages"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: shailan.DropDownMenu.php:145 shailan.DropDownMenu.php:271
|
81 |
+
msgid "Categories"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: shailan.DropDownMenu.php:147 shailan.DropDownMenu.php:273
|
85 |
+
msgid "Exclude:"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: shailan.DropDownMenu.php:148
|
89 |
+
msgid "Page IDs, separated by commas."
|
90 |
+
msgstr ""
|
91 |
+
|
92 |
+
#: shailan.DropDownMenu.php:152 shailan.DropDownMenu.php:278
|
93 |
+
msgid "Add login/logout"
|
94 |
+
msgstr ""
|
95 |
+
|
96 |
+
#: shailan.DropDownMenu.php:154 shailan.DropDownMenu.php:280
|
97 |
+
msgid "Add Register/Site Admin"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#: shailan.DropDownMenu.php:156 shailan.DropDownMenu.php:282
|
101 |
+
msgid "Vertical menu"
|
102 |
+
msgstr ""
|
103 |
+
|
104 |
+
#: shailan.DropDownMenu.php:159 shailan.DropDownMenu.php:287
|
105 |
+
msgid "Inline Style:"
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
#: shailan.DropDownMenu.php:160
|
109 |
+
msgid "Applied to menu container <div>"
|
110 |
+
msgstr ""
|
111 |
+
|
112 |
+
#: shailan.DropDownMenu.php:162
|
113 |
+
msgid ""
|
114 |
+
"NOTE: Widgets have their own options. Those options won't affect widgets."
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: shailan.DropDownMenu.php:166
|
118 |
+
msgid ""
|
119 |
+
"NOTE : Onscreen theme edit will be available soon. Be sure to check <a href="
|
120 |
+
"\"http://shailan.com\">shailan.com</a> regularly for updates."
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: shailan.DropDownMenu.php:169
|
124 |
+
msgid "Save Changes"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: shailan.DropDownMenu.php:171
|
128 |
+
msgid ""
|
129 |
+
"Visit <a href=\"http://shailan.com\">shailan.com</a> for more wordpress "
|
130 |
+
"themes, plugins and widgets."
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: shailan.DropDownMenu.php:222
|
134 |
+
msgid "Home"
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: shailan.DropDownMenu.php:285
|
138 |
+
msgid "Align:"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: shailan.DropDownMenu.php:285
|
142 |
+
msgid "Left"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: shailan.DropDownMenu.php:285
|
146 |
+
msgid "Center"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: shailan.DropDownMenu.php:285
|
150 |
+
msgid "Right"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: shailan.DropDownMenu.php:288
|
154 |
+
msgid "Applied to menu container <div>."
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: shailan.DropDownMenu.php:291
|
158 |
+
msgid "Menu Style"
|
159 |
+
msgstr ""
|
160 |
+
|
161 |
+
#: shailan.DropDownMenu.php:291
|
162 |
+
msgid "Visit plugin site"
|
163 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -1,83 +1,90 @@
|
|
1 |
-
=== Dropdown Menu Widget ===
|
2 |
-
Contributors: mattsay
|
3 |
-
Donate link:
|
4 |
-
Tags: css, dropdown, menu, widget, pages, categories, multi, jquery, navigation, category list, themes, custom-styles, options-page, animations, effects
|
5 |
-
Requires at least: 2.8
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.9.
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
== Description ==
|
12 |
-
|
13 |
-
**Dropdown Menu widget** adds a beautiful dropdown menu, listing pages and categories of your blog. You can also turn your WordPress navigation menus into beautiful dropdown menus using this plugin.
|
14 |
-
|
15 |
-
Features:
|
16 |
-
|
17 |
-
* Automatically generated menus
|
18 |
-
* Supports pages, categories and custom menus
|
19 |
-
* jQuery Effects (must be enabled from panel)
|
20 |
-
* Customizable color scheme (select Custom Theme from options to activate)
|
21 |
-
* Vertical or Horizontal Menus
|
22 |
-
* Supports Multiple Instances
|
23 |
-
* Can be embedded into theme using [PHP Template Tag](
|
24 |
-
|
25 |
-
*Documentation & Simple Tutorials to Get You Started:*
|
26 |
-
|
27 |
-
* [Dropdown Menu Widget Help](
|
28 |
-
* [Dropdown Menu PHP Template Tag Usage](
|
29 |
-
* [Using Custom Menus In Dropdown Menu Widget](
|
30 |
-
* [Tutorial: Create your very own dropdown menu stylesheet](
|
31 |
-
* [Hook: Append Categories Menu To Pages Menu](
|
32 |
-
* [View all posts tagged `Dropdown Menu Widget`](
|
33 |
-
|
34 |
-
If you like this plugin, please [donate](
|
35 |
-
|
36 |
-
Please report issues on [Github Issues Page](https://github.com/shailancom/dropdown-menu-widget/issues).
|
37 |
-
Visit source on [github](https://github.com/shailancom/dropdown-menu-widget)
|
38 |
-
|
39 |
-
== Installation ==
|
40 |
-
|
41 |
-
Dropdown menu widget is so easy to setup. Just follow the steps below to add it to your site.
|
42 |
-
|
43 |
-
1. Login to your WordPress dashboard and go to Plugins > Add New.
|
44 |
-
2. If you have downloaded the plugin, click on `Upload` link and upload the plugin.
|
45 |
-
3. If you haven't downloaded yet, type `dropdown menu widget` to search field and click `Search`.
|
46 |
-
4. Click on `Install` and click `Activate plugin` once it is loaded.
|
47 |
-
5. Go to `Dropdown menu settings` under `Settings` to change dropdown theme and edit your settings.
|
48 |
-
6. Add the dropdown menu to your site using `Widgets` or template tag codes.
|
49 |
-
7. Done. Enjoy!
|
50 |
-
|
51 |
-
== Frequently Asked Questions ==
|
52 |
-
|
53 |
-
= I don't have sidebar on my header, how can I add one? =
|
54 |
-
|
55 |
-
Adding a sidebar in WordPress is a quite easy task. You can [read instructions here](http://metinsaylan.com/wordpress/2010/04/30/how-to-widgetize-your-theme-in-3-simple-steps/). If you don't want to add a sidebar consider using [PHP template tag](http://metinsaylan.com/wordpress/2011/07/31/dropdown-menu-widget-template-tag-usage-explained/) instead.
|
56 |
-
|
57 |
-
= I added this widget to my sidebar but it looks all weird! =
|
58 |
-
|
59 |
-
This widget is intended for *wide header widget areas*, not regular sidebars. You can [add a sidebar](
|
60 |
-
|
61 |
-
= Can I create my own theme? =
|
62 |
-
|
63 |
-
Since this plugin works on CSS, if you are capable of writing CSS, you can customize the theme as you like it. If you want full customization select `None` as your theme.
|
64 |
-
|
65 |
-
= I don't know CSS, how can I customize it? =
|
66 |
-
|
67 |
-
Plugin comes with various themes already installed. If you don't like existing themes put `dropdown.css` in your theme root and it will be selectable on themes list ;)
|
68 |
-
|
69 |
-
= I found a bug! Where do I submit it? =
|
70 |
-
|
71 |
-
Please submit errors, bugs or requests on [Dropdown Menu Widget Github](https://github.com/shailancom/dropdown-menu-widget/issues) page.
|
72 |
-
|
73 |
-
== Screenshots ==
|
74 |
-
|
75 |
-
1. A preview of the widget in action
|
76 |
-
1. Shiny Black menu theme
|
77 |
-
1. Brand new dropdown menu options page.
|
78 |
-
|
79 |
-
== Changelog ==
|
80 |
-
|
81 |
-
= 1.9.
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Dropdown Menu Widget ===
|
2 |
+
Contributors: mattsay
|
3 |
+
Donate link: https://metinsaylan.com/donate/
|
4 |
+
Tags: css, dropdown, menu, widget, pages, categories, multi, jquery, navigation, category list, themes, custom-styles, options-page, animations, effects
|
5 |
+
Requires at least: 2.8
|
6 |
+
Tested up to: 4.9.8
|
7 |
+
Stable tag: 1.9.7
|
8 |
+
|
9 |
+
A Dropdown Menu Plugin to create automatic navigation using Pages, Categories or Custom Menu Items. Comes with customizable themes and jquery effects.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
**Dropdown Menu widget** adds a beautiful dropdown menu, listing pages and categories of your blog. You can also turn your WordPress navigation menus into beautiful dropdown menus using this plugin.
|
14 |
+
|
15 |
+
Features:
|
16 |
+
|
17 |
+
* Automatically generated menus
|
18 |
+
* Supports pages, categories and custom menus
|
19 |
+
* jQuery Effects (must be enabled from panel)
|
20 |
+
* Customizable color scheme (select Custom Theme from options to activate)
|
21 |
+
* Vertical or Horizontal Menus
|
22 |
+
* Supports Multiple Instances
|
23 |
+
* Can be embedded into theme using [PHP Template Tag](https://metinsaylan.com/4598/dropdown-menu-widget-template-tag-usage-explained/)
|
24 |
+
|
25 |
+
*Documentation & Simple Tutorials to Get You Started:*
|
26 |
+
|
27 |
+
* [Dropdown Menu Widget Help](https://metinsaylan.com/wordpress/plugins/dropdown-menu/help/)
|
28 |
+
* [Dropdown Menu PHP Template Tag Usage](https://metinsaylan.com/4598/dropdown-menu-widget-template-tag-usage-explained/)
|
29 |
+
* [Using Custom Menus In Dropdown Menu Widget](https://metinsaylan.com/1025/custom-dropdown-menu-using-wordpress-3-nav-menus/)
|
30 |
+
* [Tutorial: Create your very own dropdown menu stylesheet](https://metinsaylan.com/600/tutorial-create-your-very-own-dropdown-menu-stylesheet/)
|
31 |
+
* [Hook: Append Categories Menu To Pages Menu](https://metinsaylan.com/4570/how-to-add-categories-dropdown-to-the-end-of-dropdown-menu-widget/)
|
32 |
+
* [View all posts tagged `Dropdown Menu Widget`](https://metinsaylan.com/tag/dropdown-menu-widget/)
|
33 |
+
|
34 |
+
If you like this plugin, please [donate](https://metinsaylan.com/donate/).
|
35 |
+
|
36 |
+
Please report issues on [Github Issues Page](https://github.com/shailancom/dropdown-menu-widget/issues).
|
37 |
+
Visit source on [github](https://github.com/shailancom/dropdown-menu-widget)
|
38 |
+
|
39 |
+
== Installation ==
|
40 |
+
|
41 |
+
Dropdown menu widget is so easy to setup. Just follow the steps below to add it to your site.
|
42 |
+
|
43 |
+
1. Login to your WordPress dashboard and go to Plugins > Add New.
|
44 |
+
2. If you have downloaded the plugin, click on `Upload` link and upload the plugin.
|
45 |
+
3. If you haven't downloaded yet, type `dropdown menu widget` to search field and click `Search`.
|
46 |
+
4. Click on `Install` and click `Activate plugin` once it is loaded.
|
47 |
+
5. Go to `Dropdown menu settings` under `Settings` to change dropdown theme and edit your settings.
|
48 |
+
6. Add the dropdown menu to your site using `Widgets` or template tag codes.
|
49 |
+
7. Done. Enjoy!
|
50 |
+
|
51 |
+
== Frequently Asked Questions ==
|
52 |
+
|
53 |
+
= I don't have sidebar on my header, how can I add one? =
|
54 |
+
|
55 |
+
Adding a sidebar in WordPress is a quite easy task. You can [read instructions here](http://metinsaylan.com/wordpress/2010/04/30/how-to-widgetize-your-theme-in-3-simple-steps/). If you don't want to add a sidebar consider using [PHP template tag](http://metinsaylan.com/wordpress/2011/07/31/dropdown-menu-widget-template-tag-usage-explained/) instead.
|
56 |
+
|
57 |
+
= I added this widget to my sidebar but it looks all weird! =
|
58 |
+
|
59 |
+
This widget is intended for *wide header widget areas*, not regular sidebars. You can [add a sidebar](https://metinsaylan.com/727/how-to-widgetize-your-theme-in-3-simple-steps/) to your theme or you can [get a theme](http://metinsaylan.com/lists/themes-support-dropdown/) that supports dropdown menu widget. If you don't want to add a sidebar, you can use [PHP template tag](https://metinsaylan.com/4598/dropdown-menu-widget-template-tag-usage-explained/) instead.
|
60 |
+
|
61 |
+
= Can I create my own theme? =
|
62 |
+
|
63 |
+
Since this plugin works on CSS, if you are capable of writing CSS, you can customize the theme as you like it. If you want full customization select `None` as your theme.
|
64 |
+
|
65 |
+
= I don't know CSS, how can I customize it? =
|
66 |
+
|
67 |
+
Plugin comes with various themes already installed. If you don't like existing themes put `dropdown.css` in your theme root and it will be selectable on themes list ;)
|
68 |
+
|
69 |
+
= I found a bug! Where do I submit it? =
|
70 |
+
|
71 |
+
Please submit errors, bugs or requests on [Dropdown Menu Widget Github](https://github.com/shailancom/dropdown-menu-widget/issues) page.
|
72 |
+
|
73 |
+
== Screenshots ==
|
74 |
+
|
75 |
+
1. A preview of the widget in action
|
76 |
+
1. Shiny Black menu theme
|
77 |
+
1. Brand new dropdown menu options page.
|
78 |
+
|
79 |
+
== Changelog ==
|
80 |
+
|
81 |
+
= 1.9.7 =
|
82 |
+
* Fixed deprecated function errors
|
83 |
+
* Updated readme links
|
84 |
+
* Removed plugin activation redirect
|
85 |
+
* Fix capability for options page
|
86 |
+
* Remove deprecated screen_icon
|
87 |
+
* Fix options page help links
|
88 |
+
* Fix options std value missing error
|
89 |
+
|
90 |
+
A list of all changes can be found on [Changelog page on Github](https://github.com/shailancom/dropdown-menu-widget/blob/master/CHANGELOG.md)
|
shailan-category-walker.php
CHANGED
@@ -1,91 +1,91 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class shailan_CategoryWalker extends Walker {
|
4 |
-
|
5 |
-
var $tree_type = 'category';
|
6 |
-
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
|
7 |
-
|
8 |
-
function start_lvl( &$output, $depth = 0, $args = array() ) {
|
9 |
-
if ( 'list' != $args['style'] )
|
10 |
-
return;
|
11 |
-
|
12 |
-
$indent = str_repeat("\t", $depth);
|
13 |
-
$output .= "$indent<ul class='children'>\n";
|
14 |
-
}
|
15 |
-
|
16 |
-
function end_lvl( &$output, $depth = 0, $args = array() ) {
|
17 |
-
if ( 'list' != $args['style'] )
|
18 |
-
return;
|
19 |
-
|
20 |
-
$indent = str_repeat("\t", $depth);
|
21 |
-
$output .= "$indent</ul>\n";
|
22 |
-
}
|
23 |
-
|
24 |
-
function start_el( &$output, $object, $depth = 0, $args = Array(), $current_object_id = 0 ) {
|
25 |
-
extract($args);
|
26 |
-
|
27 |
-
$cat_name = esc_attr( $category->name);
|
28 |
-
$cat_name = apply_filters( 'list_cats', $cat_name, $category );
|
29 |
-
$link = '<a href="' . get_category_link( $category->term_id ) . '" ';
|
30 |
-
$link .= '><span>';
|
31 |
-
$link .= $cat_name . '</span></a>';
|
32 |
-
|
33 |
-
if ( (! empty($feed_image)) || (! empty($feed)) ) {
|
34 |
-
$link .= ' ';
|
35 |
-
|
36 |
-
if ( empty($feed_image) )
|
37 |
-
$link .= '(';
|
38 |
-
|
39 |
-
$link .= '<a href="' . get_category_feed_link($category->term_id, $feed_type) . '"';
|
40 |
-
|
41 |
-
if ( empty($feed) )
|
42 |
-
$alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
|
43 |
-
else {
|
44 |
-
$title = ' title="' . $feed . '"';
|
45 |
-
$alt = ' alt="' . $feed . '"';
|
46 |
-
$name = $feed;
|
47 |
-
}
|
48 |
-
|
49 |
-
$link .= '>';
|
50 |
-
|
51 |
-
if ( empty($feed_image) )
|
52 |
-
$link .= $name;
|
53 |
-
else
|
54 |
-
$link .= "<img src='$feed_image'$alt" . ' />';
|
55 |
-
$link .= '</a>';
|
56 |
-
if ( empty($feed_image) )
|
57 |
-
$link .= ')';
|
58 |
-
}
|
59 |
-
|
60 |
-
if ( isset($show_count) && $show_count )
|
61 |
-
$link .= ' (' . intval($category->count) . ')';
|
62 |
-
|
63 |
-
if ( isset($show_date) && $show_date ) {
|
64 |
-
$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
|
65 |
-
}
|
66 |
-
|
67 |
-
if ( isset($current_category) && $current_category )
|
68 |
-
$_current_category = get_category( $current_category );
|
69 |
-
|
70 |
-
if ( 'list' == $args['style'] ) {
|
71 |
-
$output .= "\t<li";
|
72 |
-
$class = 'cat-item cat-item-'.$category->term_id;
|
73 |
-
if ( isset($current_category) && $current_category && ($category->term_id == $current_category) )
|
74 |
-
$class .= ' current-cat';
|
75 |
-
elseif ( isset($_current_category) && $_current_category && ($category->term_id == $_current_category->parent) )
|
76 |
-
$class .= ' current-cat-parent';
|
77 |
-
$output .= ' class="'.$class.'"';
|
78 |
-
$output .= ">$link\n";
|
79 |
-
} else {
|
80 |
-
$output .= "\t$link<br />\n";
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
function end_el( &$output, $object, $depth = 0, $args = Array() ) {
|
85 |
-
if ( 'list' != $args['style'] )
|
86 |
-
return;
|
87 |
-
|
88 |
-
$output .= "</li>\n";
|
89 |
-
}
|
90 |
-
|
91 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class shailan_CategoryWalker extends Walker {
|
4 |
+
|
5 |
+
var $tree_type = 'category';
|
6 |
+
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
|
7 |
+
|
8 |
+
function start_lvl( &$output, $depth = 0, $args = array() ) {
|
9 |
+
if ( 'list' != $args['style'] )
|
10 |
+
return;
|
11 |
+
|
12 |
+
$indent = str_repeat("\t", $depth);
|
13 |
+
$output .= "$indent<ul class='children'>\n";
|
14 |
+
}
|
15 |
+
|
16 |
+
function end_lvl( &$output, $depth = 0, $args = array() ) {
|
17 |
+
if ( 'list' != $args['style'] )
|
18 |
+
return;
|
19 |
+
|
20 |
+
$indent = str_repeat("\t", $depth);
|
21 |
+
$output .= "$indent</ul>\n";
|
22 |
+
}
|
23 |
+
|
24 |
+
function start_el( &$output, $object, $depth = 0, $args = Array(), $current_object_id = 0 ) {
|
25 |
+
extract($args);
|
26 |
+
|
27 |
+
$cat_name = esc_attr( $category->name);
|
28 |
+
$cat_name = apply_filters( 'list_cats', $cat_name, $category );
|
29 |
+
$link = '<a href="' . get_category_link( $category->term_id ) . '" ';
|
30 |
+
$link .= '><span>';
|
31 |
+
$link .= $cat_name . '</span></a>';
|
32 |
+
|
33 |
+
if ( (! empty($feed_image)) || (! empty($feed)) ) {
|
34 |
+
$link .= ' ';
|
35 |
+
|
36 |
+
if ( empty($feed_image) )
|
37 |
+
$link .= '(';
|
38 |
+
|
39 |
+
$link .= '<a href="' . get_category_feed_link($category->term_id, $feed_type) . '"';
|
40 |
+
|
41 |
+
if ( empty($feed) )
|
42 |
+
$alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
|
43 |
+
else {
|
44 |
+
$title = ' title="' . $feed . '"';
|
45 |
+
$alt = ' alt="' . $feed . '"';
|
46 |
+
$name = $feed;
|
47 |
+
}
|
48 |
+
|
49 |
+
$link .= '>';
|
50 |
+
|
51 |
+
if ( empty($feed_image) )
|
52 |
+
$link .= $name;
|
53 |
+
else
|
54 |
+
$link .= "<img src='$feed_image'$alt" . ' />';
|
55 |
+
$link .= '</a>';
|
56 |
+
if ( empty($feed_image) )
|
57 |
+
$link .= ')';
|
58 |
+
}
|
59 |
+
|
60 |
+
if ( isset($show_count) && $show_count )
|
61 |
+
$link .= ' (' . intval($category->count) . ')';
|
62 |
+
|
63 |
+
if ( isset($show_date) && $show_date ) {
|
64 |
+
$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( isset($current_category) && $current_category )
|
68 |
+
$_current_category = get_category( $current_category );
|
69 |
+
|
70 |
+
if ( 'list' == $args['style'] ) {
|
71 |
+
$output .= "\t<li";
|
72 |
+
$class = 'cat-item cat-item-'.$category->term_id;
|
73 |
+
if ( isset($current_category) && $current_category && ($category->term_id == $current_category) )
|
74 |
+
$class .= ' current-cat';
|
75 |
+
elseif ( isset($_current_category) && $_current_category && ($category->term_id == $_current_category->parent) )
|
76 |
+
$class .= ' current-cat-parent';
|
77 |
+
$output .= ' class="'.$class.'"';
|
78 |
+
$output .= ">$link\n";
|
79 |
+
} else {
|
80 |
+
$output .= "\t$link<br />\n";
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
function end_el( &$output, $object, $depth = 0, $args = Array() ) {
|
85 |
+
if ( 'list' != $args['style'] )
|
86 |
+
return;
|
87 |
+
|
88 |
+
$output .= "</li>\n";
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
shailan-dropdown-menu-options.php
CHANGED
@@ -1,336 +1,335 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function
|
4 |
-
return " <a href=\"
|
5 |
-
}
|
6 |
-
|
7 |
-
// Define themes
|
8 |
-
$default_themes = array(
|
9 |
-
'None' => '*none*',
|
10 |
-
'From URL' => '*url*',
|
11 |
-
'Custom CSS' => '*custom*',
|
12 |
-
'Color Scheme' => 'color-scheme',
|
13 |
-
'Web 2.0' => plugins_url('/themes/web20.css', __FILE__),
|
14 |
-
'Simple White' => plugins_url('/themes/simple.css', __FILE__),
|
15 |
-
'Wordpress Default' => plugins_url('/themes/wpdefault.css', __FILE__),
|
16 |
-
'Grayscale' => plugins_url('/themes/grayscale.css', __FILE__),
|
17 |
-
'Aqua' => plugins_url('/themes/aqua.css', __FILE__),
|
18 |
-
'Blue gradient' => plugins_url('/themes/simple-blue.css', __FILE__),
|
19 |
-
'Shiny Black' => plugins_url('/themes/shiny-black.css', __FILE__),
|
20 |
-
'Flickr' => plugins_url('/themes/flickr.com/default.ultimate.css', __FILE__),
|
21 |
-
'Nvidia' => plugins_url('/themes/nvidia.com/default.advanced.css', __FILE__),
|
22 |
-
'Adobe' => plugins_url('/themes/adobe.com/default.advanced.css', __FILE__),
|
23 |
-
'MTV' => plugins_url('/themes/mtv.com/default.ultimate.css', __FILE__),
|
24 |
-
'Hulu' => plugins_url('/themes/hulu/hulu.css', __FILE__),
|
25 |
-
'Rounded Corners' => plugins_url('/themes/rounded-corners.css', __FILE__),
|
26 |
-
'Rounded Corners Light' => plugins_url('/themes/rounded-corners-light.css', __FILE__),
|
27 |
-
'Pills' => plugins_url('/themes/pills.css', __FILE__)
|
28 |
-
);
|
29 |
-
|
30 |
-
$available_themes = array();
|
31 |
-
|
32 |
-
// Check for theme style file
|
33 |
-
if( file_exists( trailingslashit( get_stylesheet_directory() ) . 'dropdown.css') ){
|
34 |
-
$available_themes['Dropdown.css (theme)'] = get_stylesheet_directory_uri() . '/dropdown.css';
|
35 |
-
}
|
36 |
-
|
37 |
-
if( file_exists( trailingslashit( get_template_directory() ) . 'dropdown.css') ){
|
38 |
-
$available_themes['Dropdown.css (template)'] = get_template_directory_uri() . '/dropdown.css';
|
39 |
-
}
|
40 |
-
|
41 |
-
$available_themes = array_merge( $available_themes, $default_themes );
|
42 |
-
|
43 |
-
// Swap array for options page
|
44 |
-
$themes = array();
|
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 |
-
"
|
163 |
-
"
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
"
|
168 |
-
"
|
169 |
-
"
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
"
|
174 |
-
"
|
175 |
-
"
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
"
|
180 |
-
"
|
181 |
-
"
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
"
|
186 |
-
"
|
187 |
-
"
|
188 |
-
"
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
"
|
195 |
-
"
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
"
|
201 |
-
"
|
202 |
-
"
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
"
|
207 |
-
"
|
208 |
-
"
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
"
|
213 |
-
"
|
214 |
-
"
|
215 |
-
"
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
"
|
220 |
-
"
|
221 |
-
"
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
"
|
228 |
-
"
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
"
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
"
|
239 |
-
"
|
240 |
-
"
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
"
|
247 |
-
"
|
248 |
-
"
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
"
|
253 |
-
"
|
254 |
-
"
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
"
|
259 |
-
"
|
260 |
-
"
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
"
|
265 |
-
"
|
266 |
-
"
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
"
|
271 |
-
"
|
272 |
-
"
|
273 |
-
"
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
"
|
280 |
-
"
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
"
|
286 |
-
"
|
287 |
-
"
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
"
|
292 |
-
"
|
293 |
-
"
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
"
|
298 |
-
"
|
299 |
-
"
|
300 |
-
"
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
"
|
306 |
-
"
|
307 |
-
"
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
"
|
312 |
-
"
|
313 |
-
"
|
314 |
-
"
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
"
|
320 |
-
"
|
321 |
-
"
|
322 |
-
"
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
"
|
328 |
-
"
|
329 |
-
"
|
330 |
-
"
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function ddm_help_icon($hash){
|
4 |
+
return " <a href=\"https://metinsaylan.com/wordpress/plugins/dropdown-menu/help/#".$hash."\" target=\"_blank\" class=\"help-icon\">(?)</a>";
|
5 |
+
}
|
6 |
+
|
7 |
+
// Define themes
|
8 |
+
$default_themes = array(
|
9 |
+
'None' => '*none*',
|
10 |
+
'From URL' => '*url*',
|
11 |
+
'Custom CSS' => '*custom*',
|
12 |
+
'Color Scheme' => 'color-scheme',
|
13 |
+
'Web 2.0' => plugins_url('/themes/web20.css', __FILE__),
|
14 |
+
'Simple White' => plugins_url('/themes/simple.css', __FILE__),
|
15 |
+
'Wordpress Default' => plugins_url('/themes/wpdefault.css', __FILE__),
|
16 |
+
'Grayscale' => plugins_url('/themes/grayscale.css', __FILE__),
|
17 |
+
'Aqua' => plugins_url('/themes/aqua.css', __FILE__),
|
18 |
+
'Blue gradient' => plugins_url('/themes/simple-blue.css', __FILE__),
|
19 |
+
'Shiny Black' => plugins_url('/themes/shiny-black.css', __FILE__),
|
20 |
+
'Flickr' => plugins_url('/themes/flickr.com/default.ultimate.css', __FILE__),
|
21 |
+
'Nvidia' => plugins_url('/themes/nvidia.com/default.advanced.css', __FILE__),
|
22 |
+
'Adobe' => plugins_url('/themes/adobe.com/default.advanced.css', __FILE__),
|
23 |
+
'MTV' => plugins_url('/themes/mtv.com/default.ultimate.css', __FILE__),
|
24 |
+
'Hulu' => plugins_url('/themes/hulu/hulu.css', __FILE__),
|
25 |
+
'Rounded Corners' => plugins_url('/themes/rounded-corners.css', __FILE__),
|
26 |
+
'Rounded Corners Light' => plugins_url('/themes/rounded-corners-light.css', __FILE__),
|
27 |
+
'Pills' => plugins_url('/themes/pills.css', __FILE__)
|
28 |
+
);
|
29 |
+
|
30 |
+
$available_themes = array();
|
31 |
+
|
32 |
+
// Check for theme style file
|
33 |
+
if( file_exists( trailingslashit( get_stylesheet_directory() ) . 'dropdown.css') ){
|
34 |
+
$available_themes['Dropdown.css (theme)'] = get_stylesheet_directory_uri() . '/dropdown.css';
|
35 |
+
}
|
36 |
+
|
37 |
+
if( file_exists( trailingslashit( get_template_directory() ) . 'dropdown.css') ){
|
38 |
+
$available_themes['Dropdown.css (template)'] = get_template_directory_uri() . '/dropdown.css';
|
39 |
+
}
|
40 |
+
|
41 |
+
$available_themes = array_merge( $available_themes, $default_themes );
|
42 |
+
|
43 |
+
// Swap array for options page
|
44 |
+
$themes = array();
|
45 |
+
$themes = array_flip( $available_themes );
|
46 |
+
|
47 |
+
$overlays = array(
|
48 |
+
'none'=>'none',
|
49 |
+
'glassy'=>'glassy',
|
50 |
+
'flat'=>'flat',
|
51 |
+
'shadow'=>'shadow',
|
52 |
+
'soft' =>'soft'
|
53 |
+
);
|
54 |
+
|
55 |
+
$alignment = array( 'left'=>'left', 'center' => 'center', 'right'=> 'right' );
|
56 |
+
$types = array( 'pages'=>'Pages', 'categories'=>'Categories' );
|
57 |
+
$effects = array('fade'=>'Fade In/Out', 'slide'=>'Slide Up/Down');
|
58 |
+
$speed = array( '400'=>'Normal', 'fast'=>'Fast', 'slow'=>'Slow' );
|
59 |
+
$delay = array('100'=>'100', '200'=>'200', '300'=>'300', '400'=>'400', '500'=>'500', '600'=>'600','700'=>'700');
|
60 |
+
|
61 |
+
if( function_exists('wp_nav_menu') ){
|
62 |
+
// Get available menus
|
63 |
+
$menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) );
|
64 |
+
$navmenus = array();
|
65 |
+
|
66 |
+
if($menus){
|
67 |
+
foreach( $menus as $menu ){
|
68 |
+
$navmenus[ 'navmenu_' . $menu->term_id ] = $menu->name;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
// Merge type with menu array
|
73 |
+
$types = array_merge($types, $navmenus);
|
74 |
+
}
|
75 |
+
|
76 |
+
$this->menu_types = $types; // Back it up
|
77 |
+
|
78 |
+
// Registered menu locations
|
79 |
+
global $_wp_registered_nav_menus;
|
80 |
+
|
81 |
+
// Define plugin options
|
82 |
+
$options = array(
|
83 |
+
|
84 |
+
array(
|
85 |
+
"name" => "General",
|
86 |
+
"label" => __("General"),
|
87 |
+
"type" => "section"
|
88 |
+
),
|
89 |
+
|
90 |
+
array( "name" => "Dropdown Menu Theme",
|
91 |
+
"desc" => "Skin for the menu".ddm_help_icon("menu-theme"),
|
92 |
+
"id" => "shailan_dm_active_theme",
|
93 |
+
"std" => plugins_url("/dropdown-menu-widget/themes/web20.css"),
|
94 |
+
"options" => $themes,
|
95 |
+
"type" => "select"),
|
96 |
+
|
97 |
+
array( "name" => "Theme URL",
|
98 |
+
"desc" => "If <strong>From URL</strong> is selected you can specify theme URL here. ".ddm_help_icon("theme-url"),
|
99 |
+
"id" => "shailan_dm_theme_url",
|
100 |
+
"std" => "http://",
|
101 |
+
"type" => "text"),
|
102 |
+
|
103 |
+
array( "name" => "Use Theme Location",
|
104 |
+
"desc" => "This option enables use of theme location.". ddm_help_icon("theme-location"),
|
105 |
+
"id" => "shailan_dm_location_enabled",
|
106 |
+
"type" => "checkbox",
|
107 |
+
"std" => "off" ),
|
108 |
+
|
109 |
+
array( "name" => "Theme Location",
|
110 |
+
"desc" => "This option will place dropdown menu automatically to the theme location.". ddm_help_icon("theme-location"),
|
111 |
+
"id" => "shailan_dm_location",
|
112 |
+
"type" => "select",
|
113 |
+
"options" => $_wp_registered_nav_menus ),
|
114 |
+
|
115 |
+
array( "name" => "Rename Homepage",
|
116 |
+
"desc" => "You can change your homepage link text here " . ddm_help_icon("rename-homepage"),
|
117 |
+
"id" => "shailan_dm_home_tag",
|
118 |
+
"std" => __("Home"),
|
119 |
+
"type" => "text"),
|
120 |
+
|
121 |
+
array( "name" => "Show parent indicators",
|
122 |
+
"desc" => "This option will enable arrows next to parent items.". ddm_help_icon("parent-indicators"),
|
123 |
+
"id" => "shailan_dm_arrows",
|
124 |
+
"type" => "checkbox",
|
125 |
+
"std" => "on" ),
|
126 |
+
|
127 |
+
array( "name" => "Indicator color",
|
128 |
+
"desc" => "Change indicator color (eg. #000000).". ddm_help_icon("indicator-color"),
|
129 |
+
"id" => "shailan_dm_arrow_color",
|
130 |
+
"std" => "rgba(0,0,0,0.5)",
|
131 |
+
"type" => "text"),
|
132 |
+
|
133 |
+
array( "type" => "close" ),
|
134 |
+
|
135 |
+
array(
|
136 |
+
"name" => "Template Tag",
|
137 |
+
"label" => __("Template Tag"),
|
138 |
+
"type" => "section"
|
139 |
+
),
|
140 |
+
|
141 |
+
array(
|
142 |
+
"desc" => "Settings here only effect menus inserted with <strong>template tag</strong> : <code><?php shailan_dropdown_menu(); ?></code>. Widget settings are NOT affected by these settings. ".ddm_help_icon("template-tag"),
|
143 |
+
"type" => "paragraph"
|
144 |
+
),
|
145 |
+
|
146 |
+
array( "name" => "Menu Type",
|
147 |
+
"desc" => "Dropdown Menu Type".ddm_help_icon("menu-type"),
|
148 |
+
"id" => "shailan_dm_type",
|
149 |
+
"std" => "pages",
|
150 |
+
"options" => $types,
|
151 |
+
"type" => "select"),
|
152 |
+
|
153 |
+
array( "name" => "Home link",
|
154 |
+
"desc" => "If checked dropdown menu displays home link".ddm_help_icon("home-link"),
|
155 |
+
"id" => "shailan_dm_home",
|
156 |
+
"std" => 'on',
|
157 |
+
"type" => "checkbox"),
|
158 |
+
|
159 |
+
array( "name" => "Login",
|
160 |
+
"desc" => "If checked dropdown menu displays login link".ddm_help_icon("login"),
|
161 |
+
"id" => "shailan_dm_login",
|
162 |
+
"std" => 'on',
|
163 |
+
"type" => "checkbox"),
|
164 |
+
|
165 |
+
array( "name" => "Register / Site Admin",
|
166 |
+
"desc" => "If checked dropdown menu displays register/site admin link.".ddm_help_icon("register-site-admin"),
|
167 |
+
"id" => "shailan_dm_login",
|
168 |
+
"std" => 'on',
|
169 |
+
"type" => "checkbox"),
|
170 |
+
|
171 |
+
array( "name" => "Vertical menu",
|
172 |
+
"desc" => "If checked dropdown menu is displayed vertical.".ddm_help_icon("vertical-menu"),
|
173 |
+
"id" => "shailan_dm_vertical",
|
174 |
+
"std" => 'off',
|
175 |
+
"type" => "checkbox"),
|
176 |
+
|
177 |
+
array( "name" => "Exclude Pages",
|
178 |
+
"desc" => "Excluded page IDs.".ddm_help_icon("exclude-pages"),
|
179 |
+
"id" => "shailan_dm_exclude",
|
180 |
+
"std" => "",
|
181 |
+
"type" => "text"),
|
182 |
+
|
183 |
+
array( "name" => "Alignment",
|
184 |
+
"desc" => "Menu alignment.".ddm_help_icon("alignment"),
|
185 |
+
"id" => "shailan_dm_align",
|
186 |
+
"std" => "left",
|
187 |
+
"options" => $alignment,
|
188 |
+
"type" => "select"),
|
189 |
+
|
190 |
+
array( "type" => "close" ),
|
191 |
+
|
192 |
+
array(
|
193 |
+
"name" => "Effects",
|
194 |
+
"label" => __("Effects"),
|
195 |
+
"type" => "section"
|
196 |
+
),
|
197 |
+
|
198 |
+
array( "name" => "Enable dropdown effects",
|
199 |
+
"desc" => "If checked sub menus will use effects below". ddm_help_icon("enable-dropdown-effects"),
|
200 |
+
"std" => "on",
|
201 |
+
"id" => "shailan_dm_effects",
|
202 |
+
"type" => "checkbox"),
|
203 |
+
|
204 |
+
array( "name" => "Effect",
|
205 |
+
"desc" => "Select effect you want to use".ddm_help_icon("effect"),
|
206 |
+
"id" => "shailan_dm_effect",
|
207 |
+
"type" => "select",
|
208 |
+
"options" => $effects ),
|
209 |
+
|
210 |
+
array( "name" => "Effect Speed",
|
211 |
+
"desc" => "Select effect speed".ddm_help_icon("effect-speed"),
|
212 |
+
"id" => "shailan_dm_effect_speed",
|
213 |
+
"type" => "select",
|
214 |
+
"std" => "fast",
|
215 |
+
"options" => $speed ),
|
216 |
+
|
217 |
+
array( "name" => "Effect delay",
|
218 |
+
"desc" => "Select effect delay (uses hoverIntent)".ddm_help_icon("effect-delay"),
|
219 |
+
"id" => "shailan_dm_effect_delay",
|
220 |
+
"type" => "select",
|
221 |
+
"options" => $delay ),
|
222 |
+
|
223 |
+
array( "type" => "close" ),
|
224 |
+
|
225 |
+
array(
|
226 |
+
"name" => "custom-colors",
|
227 |
+
"label" => __("Custom colors"),
|
228 |
+
"type" => "section"
|
229 |
+
),
|
230 |
+
|
231 |
+
array(
|
232 |
+
"desc" => "Using options below you can customize certain elements of current theme. If you select <strong>Color Scheme</strong> as your theme, you will have full control over colors.",
|
233 |
+
"type" => "paragraph"
|
234 |
+
),
|
235 |
+
|
236 |
+
array( "name" => "Use custom colors",
|
237 |
+
"desc" => "If not checked custom colors won't work.".ddm_help_icon("use-custom-colors"),
|
238 |
+
"id" => "shailan_dm_custom_colors",
|
239 |
+
"std" => 'off',
|
240 |
+
"type" => "checkbox"),
|
241 |
+
|
242 |
+
array("type"=>"picker"),
|
243 |
+
|
244 |
+
array( "name" => "Menu Background Color",
|
245 |
+
"desc" => "Background color of the dropdown menu".ddm_help_icon("menu-background-color"),
|
246 |
+
"id" => "shailan_dm_color_menubg",
|
247 |
+
"std" => '#000000',
|
248 |
+
"type" => "text"),
|
249 |
+
|
250 |
+
array( "name" => "Hover Background Color",
|
251 |
+
"desc" => "Background color of list item link.".ddm_help_icon("hover-background-color"),
|
252 |
+
"id" => "shailan_dm_color_lihover",
|
253 |
+
"std" => '#333333',
|
254 |
+
"type" => "text"),
|
255 |
+
|
256 |
+
array( "name" => "Link Text Color",
|
257 |
+
"desc" => "Default link color".ddm_help_icon("link-text-color"),
|
258 |
+
"id" => "shailan_dm_color_link",
|
259 |
+
"std" => '#FFFFFF',
|
260 |
+
"type" => "text"),
|
261 |
+
|
262 |
+
array( "name" => "Link Text Color on mouse over",
|
263 |
+
"desc" => "Secondary link color".ddm_help_icon("link-text-color-on-mouse-over"),
|
264 |
+
"id" => "shailan_dm_color_hoverlink",
|
265 |
+
"std" => '#FFFFFF',
|
266 |
+
"type" => "text"),
|
267 |
+
|
268 |
+
array( "name" => "Overlay",
|
269 |
+
"desc" => "Menu overlay (Works on browsers that support png transparency only.)".ddm_help_icon("overlay"),
|
270 |
+
"id" => "shailan_dm_overlay",
|
271 |
+
"std" => "glass",
|
272 |
+
"type" => "select",
|
273 |
+
"options" => $overlays ),
|
274 |
+
|
275 |
+
array( "type" => "close" ),
|
276 |
+
|
277 |
+
array(
|
278 |
+
"name" => "Advanced",
|
279 |
+
"label" => __("Advanced"),
|
280 |
+
"type" => "section"
|
281 |
+
),
|
282 |
+
|
283 |
+
array( "name" => "Dropdown Menu Font",
|
284 |
+
"desc" => "Font family for the menu<br />Please leave blank to use your wordpress theme font.".ddm_help_icon("dropdown-menu-font"),
|
285 |
+
"id" => "shailan_dm_font",
|
286 |
+
"std" => '',
|
287 |
+
"type" => "text"),
|
288 |
+
|
289 |
+
array( "name" => "Dropdown Menu Font Size",
|
290 |
+
"desc" => "Font size of the menu items (Eg: 12px OR 1em) <br />Please leave blank to use your wordpress theme font-size.".ddm_help_icon("dropdown-menu-font-size"),
|
291 |
+
"id" => "shailan_dm_fontsize",
|
292 |
+
"std" => '',
|
293 |
+
"type" => "text"),
|
294 |
+
|
295 |
+
array(
|
296 |
+
"name" => "Custom CSS",
|
297 |
+
"desc" => "You can paste your own customization file here.".ddm_help_icon("custom-css"),
|
298 |
+
"id" => "shailan_dm_custom_css",
|
299 |
+
"std" => '',
|
300 |
+
"type" => "textarea"
|
301 |
+
),
|
302 |
+
|
303 |
+
array( "name" => "Show Empty Categories",
|
304 |
+
"desc" => "If checked categories with no posts will be shown.".ddm_help_icon("show-empty-categories"),
|
305 |
+
"id" => "shailan_dm_show_empty",
|
306 |
+
"std" => 'on',
|
307 |
+
"type" => "checkbox"),
|
308 |
+
|
309 |
+
array(
|
310 |
+
"name" => "Wrap long menu items",
|
311 |
+
"desc" => "If checked long menu items will wrap". ddm_help_icon("wrap-long-menu-items"),
|
312 |
+
"id" => "shailan_dm_allowmultiline",
|
313 |
+
"type" => "checkbox",
|
314 |
+
"std" => "off"
|
315 |
+
),
|
316 |
+
|
317 |
+
array(
|
318 |
+
"name" => "Remove title attributes",
|
319 |
+
"desc" => "This will remove 'View all posts under..' title attributes from menu links". ddm_help_icon("remove-title-attributes"),
|
320 |
+
"id" => "shailan_dm_remove_title_attributes",
|
321 |
+
"type" => "checkbox",
|
322 |
+
"std" => "off"
|
323 |
+
),
|
324 |
+
|
325 |
+
array(
|
326 |
+
"name" => "Remove links from top levels",
|
327 |
+
"desc" => "This will remove links from top level pages/categories. So user can only click to sub-level menu.". ddm_help_icon("remove-links-from-top-levels"),
|
328 |
+
"id" => "shailan_dm_remove_top_level_links",
|
329 |
+
"type" => "checkbox",
|
330 |
+
"std" => "off"
|
331 |
+
),
|
332 |
+
|
333 |
+
array( "type" => "close" )
|
334 |
+
|
335 |
+
);
|
|
shailan-multi-dropdown.php
CHANGED
@@ -1,194 +1,197 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class shailan_MultiDropDown extends WP_Widget {
|
4 |
-
/** constructor */
|
5 |
-
//function shailan_MultiDropDown() {
|
6 |
-
public function __construct() {
|
7 |
-
$widget_ops = array('classname' => 'shailan-dropdown-menu shailan-multi-dropdown', 'description' => __( 'Dropdown page & category menu', 'shailan-dropdown-menu' ) );
|
8 |
-
|
9 |
-
parent::__construct(
|
10 |
-
'multi-dropdown-menu',
|
11 |
-
__('Dropdown Multi', 'shailan-multi-dropdown'),
|
12 |
-
$widget_ops
|
13 |
-
);
|
14 |
-
|
15 |
-
|
16 |
-
$this->alt_option_name = 'widget_multi_dropdown';
|
17 |
-
|
18 |
-
$this->defaults = array(
|
19 |
-
'title' => '',
|
20 |
-
'pages' => false,
|
21 |
-
'categories' => false,
|
22 |
-
'links' => false,
|
23 |
-
'archives' => false,
|
24 |
-
'exclude' => '',
|
25 |
-
'home' => false,
|
26 |
-
'login' => false,
|
27 |
-
'admin' => false,
|
28 |
-
'vertical' => false,
|
29 |
-
'align' => 'left'
|
30 |
-
);
|
31 |
-
|
32 |
-
}
|
33 |
-
|
34 |
-
/** @see WP_Widget::widget */
|
35 |
-
function widget($args, $instance) {
|
36 |
-
extract( $args );
|
37 |
-
$widget_options = wp_parse_args( $instance, $this->defaults );
|
38 |
-
extract( $widget_options, EXTR_SKIP );
|
39 |
-
|
40 |
-
$orientation = ($vertical ? 'dropdown-vertical' : 'dropdown-horizontal');
|
41 |
-
|
42 |
-
$custom_walkers = false; //(bool) get_option('shailan_dm_customwalkers');
|
43 |
-
//$custom_walkers = !$custom_walkers;
|
44 |
-
|
45 |
-
?>
|
46 |
-
<?php echo $before_widget; ?>
|
47 |
-
|
48 |
-
<div id="shailan-dropdown-wrapper-<?php echo $this->number; ?>">
|
49 |
-
|
50 |
-
<?php do_action('dropdown_before');
|
51 |
-
echo '<div align="' . $align . '" class="'.$orientation.'-container dm-align-'.$align.'">';
|
52 |
-
?>
|
53 |
-
<table cellpadding="0" cellspacing="0">
|
54 |
-
<tr><td>
|
55 |
-
<ul class="dropdown <?php echo $orientation; ?>">
|
56 |
-
|
57 |
-
<?php do_action('dropdown_list_before'); ?>
|
58 |
-
|
59 |
-
<?php if($home){ ?>
|
60 |
-
<li class="page_item cat-item blogtab <?php if ( is_front_page() && !is_paged() ){ ?>current_page_item current-cat<?php } ?>"><a href="<?php echo get_option('home'); ?>/"><span><?php _e('Home', 'shailan-dropdown-menu'); ?></span></a></li>
|
61 |
-
<?php } ?>
|
62 |
-
|
63 |
-
<?php if($pages){ ?>
|
64 |
-
|
65 |
-
<?php if($custom_walkers){
|
66 |
-
$page_walker = new shailan_PageWalker();
|
67 |
-
wp_list_pages(array(
|
68 |
-
'walker'=>$page_walker,
|
69 |
-
'sort_column'=>'menu_order',
|
70 |
-
'depth'=>'4',
|
71 |
-
'title_li'=>'',
|
72 |
-
'exclude'=>$exclude
|
73 |
-
));
|
74 |
-
} else {
|
75 |
-
wp_list_pages(array(
|
76 |
-
'sort_column'=>'menu_order',
|
77 |
-
'depth'=>'4',
|
78 |
-
'title_li'=>'',
|
79 |
-
'exclude'=>$exclude
|
80 |
-
));
|
81 |
-
} ?>
|
82 |
-
|
83 |
-
<?php }; if($categories){ ?>
|
84 |
-
|
85 |
-
<?php
|
86 |
-
if($custom_walkers){
|
87 |
-
$cat_walker = new shailan_CategoryWalker();
|
88 |
-
wp_list_categories(array(
|
89 |
-
'walker'=>$cat_walker,
|
90 |
-
'order_by'=>'name',
|
91 |
-
'depth'=>'4',
|
92 |
-
'title_li'=>'',
|
93 |
-
'exclude'=>$exclude
|
94 |
-
));
|
95 |
-
} else {
|
96 |
-
wp_list_categories(array(
|
97 |
-
'order_by'=>'name',
|
98 |
-
'depth'=>'4',
|
99 |
-
'title_li'=>'',
|
100 |
-
'exclude'=>$exclude
|
101 |
-
));
|
102 |
-
} ?>
|
103 |
-
|
104 |
-
<?php }; ?>
|
105 |
-
|
106 |
-
<?php if($links){ ?>
|
107 |
-
<li> <a href="#"><span>Links</span></a>
|
108 |
-
<ul>
|
109 |
-
<?php wp_list_bookmarks('title_li=&category_before=&category_after=&categorize=0'); ?>
|
110 |
-
</ul>
|
111 |
-
</li>
|
112 |
-
<?php } ?>
|
113 |
-
|
114 |
-
<?php if($archives){ ?>
|
115 |
-
<li> <a href="#"><span>Archives</span></a>
|
116 |
-
<ul>
|
117 |
-
<?php
|
118 |
-
$args = array();
|
119 |
-
wp_get_archives( $args ); ?>
|
120 |
-
</ul>
|
121 |
-
</li>
|
122 |
-
<?php } ?>
|
123 |
-
|
124 |
-
<?php do_action('dropdown_list_after'); ?>
|
125 |
-
|
126 |
-
<?php if($admin){ wp_register('<li class="admintab">','</li>'); } if($login){ ?><li class="page_item"><?php wp_loginout(); ?><?php } ?>
|
127 |
-
|
128 |
-
</ul></td>
|
129 |
-
</tr></table>
|
130 |
-
</div>
|
131 |
-
|
132 |
-
<?php do_action('dropdown_after'); ?>
|
133 |
-
|
134 |
-
</div>
|
135 |
-
<?php echo $after_widget; ?>
|
136 |
-
<?php
|
137 |
-
}
|
138 |
-
|
139 |
-
/** @see WP_Widget::update */
|
140 |
-
function update($new_instance, $old_instance) {
|
141 |
-
return $new_instance;
|
142 |
-
}
|
143 |
-
|
144 |
-
/** @see WP_Widget::form */
|
145 |
-
function form($instance) {
|
146 |
-
|
147 |
-
extract( $instance );
|
148 |
-
$widget_options = wp_parse_args( $instance, $this->defaults );
|
149 |
-
extract( $widget_options, EXTR_SKIP );
|
150 |
-
|
151 |
-
?>
|
152 |
-
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title (won\'t be shown):', 'shailan-dropdown-menu'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
|
153 |
-
|
154 |
-
<p> Includes: <br/>
|
155 |
-
|
156 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('home'); ?>" name="<?php echo $this->get_field_name('home'); ?>"<?php checked( (bool) $home ); ?> />
|
157 |
-
<label for="<?php echo $this->get_field_id('home'); ?>"><?php _e( 'Homepage link' , 'shailan-dropdown-menu' ); ?></label><br />
|
158 |
-
|
159 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('pages'); ?>" name="<?php echo $this->get_field_name('pages'); ?>"<?php checked( (bool) $pages ); ?> />
|
160 |
-
<label for="<?php echo $this->get_field_id('pages'); ?>"><?php _e( 'Pages' , 'shailan-dropdown-menu' ); ?></label><br />
|
161 |
-
|
162 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('categories'); ?>" name="<?php echo $this->get_field_name('categories'); ?>"<?php checked( (bool) $categories ); ?> />
|
163 |
-
<label for="<?php echo $this->get_field_id('categories'); ?>"><?php _e( 'Categories' , 'shailan-dropdown-menu' ); ?></label><br />
|
164 |
-
|
165 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('links'); ?>" name="<?php echo $this->get_field_name('links'); ?>"<?php checked( (bool) $links ); ?> />
|
166 |
-
<label for="<?php echo $this->get_field_id('links'); ?>"><?php _e( 'Links' , 'shailan-dropdown-menu' ); ?></label><br />
|
167 |
-
|
168 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('archives'); ?>" name="<?php echo $this->get_field_name('archives'); ?>"<?php checked( (bool) $archives ); ?> />
|
169 |
-
<label for="<?php echo $this->get_field_id('archives'); ?>"><?php _e( 'Archives' , 'shailan-dropdown-menu' ); ?></label><br />
|
170 |
-
|
171 |
-
|
172 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('login'); ?>" name="<?php echo $this->get_field_name('login'); ?>"<?php checked( (bool) $login ); ?> />
|
173 |
-
<label for="<?php echo $this->get_field_id('login'); ?>"><?php _e( 'Login/logout' , 'shailan-dropdown-menu' ); ?></label><br />
|
174 |
-
|
175 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('admin'); ?>" name="<?php echo $this->get_field_name('admin'); ?>"<?php checked( (bool) $admin ); ?> />
|
176 |
-
<label for="<?php echo $this->get_field_id('admin'); ?>"><?php _e( 'Register/Site Admin' , 'shailan-dropdown-menu' ); ?></label>
|
177 |
-
</p>
|
178 |
-
|
179 |
-
<p>
|
180 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('vertical'); ?>" name="<?php echo $this->get_field_name('vertical'); ?>"<?php checked( (bool) $vertical ); ?> />
|
181 |
-
<label for="<?php echo $this->get_field_id('vertical'); ?>"><?php _e( 'Vertical menu' , 'shailan-dropdown-menu' ); ?></label>
|
182 |
-
</p>
|
183 |
-
|
184 |
-
<p><?php _e('Align:', 'shailan-dropdown-menu'); ?> <label for="left"><input type="radio" id="left" name="<?php echo $this->get_field_name('align'); ?>" value="left" <?php if($align=='left'){ echo 'checked="checked"'; } ?> /> <?php _e('Left', 'shailan-dropdown-menu'); ?></label> <label for="center"><input type="radio" id="center" name="<?php echo $this->get_field_name('align'); ?>" value="center" <?php if($align=='center'){ echo 'checked="checked"'; } ?>/> <?php _e('Center', 'shailan-dropdown-menu'); ?></label> <label for="right"><input type="radio" id="right" name="<?php echo $this->get_field_name('align'); ?>" value="right" <?php if($align=='right'){ echo 'checked="checked"'; } ?>/> <?php _e('Right', 'shailan-dropdown-menu'); ?></label></p>
|
185 |
-
|
186 |
-
<br class="clear" />
|
187 |
-
|
188 |
-
<?php
|
189 |
-
}
|
190 |
-
|
191 |
-
} // class shailan_MultiDropDown
|
192 |
-
|
193 |
-
// register widget
|
194 |
-
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class shailan_MultiDropDown extends WP_Widget {
|
4 |
+
/** constructor */
|
5 |
+
//function shailan_MultiDropDown() {
|
6 |
+
public function __construct() {
|
7 |
+
$widget_ops = array('classname' => 'shailan-dropdown-menu shailan-multi-dropdown', 'description' => __( 'Dropdown page & category menu', 'shailan-dropdown-menu' ) );
|
8 |
+
|
9 |
+
parent::__construct(
|
10 |
+
'multi-dropdown-menu',
|
11 |
+
__('Dropdown Multi', 'shailan-multi-dropdown'),
|
12 |
+
$widget_ops
|
13 |
+
);
|
14 |
+
|
15 |
+
|
16 |
+
$this->alt_option_name = 'widget_multi_dropdown';
|
17 |
+
|
18 |
+
$this->defaults = array(
|
19 |
+
'title' => '',
|
20 |
+
'pages' => false,
|
21 |
+
'categories' => false,
|
22 |
+
'links' => false,
|
23 |
+
'archives' => false,
|
24 |
+
'exclude' => '',
|
25 |
+
'home' => false,
|
26 |
+
'login' => false,
|
27 |
+
'admin' => false,
|
28 |
+
'vertical' => false,
|
29 |
+
'align' => 'left'
|
30 |
+
);
|
31 |
+
|
32 |
+
}
|
33 |
+
|
34 |
+
/** @see WP_Widget::widget */
|
35 |
+
function widget($args, $instance) {
|
36 |
+
extract( $args );
|
37 |
+
$widget_options = wp_parse_args( $instance, $this->defaults );
|
38 |
+
extract( $widget_options, EXTR_SKIP );
|
39 |
+
|
40 |
+
$orientation = ($vertical ? 'dropdown-vertical' : 'dropdown-horizontal');
|
41 |
+
|
42 |
+
$custom_walkers = false; //(bool) get_option('shailan_dm_customwalkers');
|
43 |
+
//$custom_walkers = !$custom_walkers;
|
44 |
+
|
45 |
+
?>
|
46 |
+
<?php echo $before_widget; ?>
|
47 |
+
|
48 |
+
<div id="shailan-dropdown-wrapper-<?php echo $this->number; ?>">
|
49 |
+
|
50 |
+
<?php do_action('dropdown_before');
|
51 |
+
echo '<div align="' . $align . '" class="'.$orientation.'-container dm-align-'.$align.'">';
|
52 |
+
?>
|
53 |
+
<table cellpadding="0" cellspacing="0">
|
54 |
+
<tr><td>
|
55 |
+
<ul class="dropdown <?php echo $orientation; ?>">
|
56 |
+
|
57 |
+
<?php do_action('dropdown_list_before'); ?>
|
58 |
+
|
59 |
+
<?php if($home){ ?>
|
60 |
+
<li class="page_item cat-item blogtab <?php if ( is_front_page() && !is_paged() ){ ?>current_page_item current-cat<?php } ?>"><a href="<?php echo get_option('home'); ?>/"><span><?php _e('Home', 'shailan-dropdown-menu'); ?></span></a></li>
|
61 |
+
<?php } ?>
|
62 |
+
|
63 |
+
<?php if($pages){ ?>
|
64 |
+
|
65 |
+
<?php if($custom_walkers){
|
66 |
+
$page_walker = new shailan_PageWalker();
|
67 |
+
wp_list_pages(array(
|
68 |
+
'walker'=>$page_walker,
|
69 |
+
'sort_column'=>'menu_order',
|
70 |
+
'depth'=>'4',
|
71 |
+
'title_li'=>'',
|
72 |
+
'exclude'=>$exclude
|
73 |
+
));
|
74 |
+
} else {
|
75 |
+
wp_list_pages(array(
|
76 |
+
'sort_column'=>'menu_order',
|
77 |
+
'depth'=>'4',
|
78 |
+
'title_li'=>'',
|
79 |
+
'exclude'=>$exclude
|
80 |
+
));
|
81 |
+
} ?>
|
82 |
+
|
83 |
+
<?php }; if($categories){ ?>
|
84 |
+
|
85 |
+
<?php
|
86 |
+
if($custom_walkers){
|
87 |
+
$cat_walker = new shailan_CategoryWalker();
|
88 |
+
wp_list_categories(array(
|
89 |
+
'walker'=>$cat_walker,
|
90 |
+
'order_by'=>'name',
|
91 |
+
'depth'=>'4',
|
92 |
+
'title_li'=>'',
|
93 |
+
'exclude'=>$exclude
|
94 |
+
));
|
95 |
+
} else {
|
96 |
+
wp_list_categories(array(
|
97 |
+
'order_by'=>'name',
|
98 |
+
'depth'=>'4',
|
99 |
+
'title_li'=>'',
|
100 |
+
'exclude'=>$exclude
|
101 |
+
));
|
102 |
+
} ?>
|
103 |
+
|
104 |
+
<?php }; ?>
|
105 |
+
|
106 |
+
<?php if($links){ ?>
|
107 |
+
<li> <a href="#"><span>Links</span></a>
|
108 |
+
<ul>
|
109 |
+
<?php wp_list_bookmarks('title_li=&category_before=&category_after=&categorize=0'); ?>
|
110 |
+
</ul>
|
111 |
+
</li>
|
112 |
+
<?php } ?>
|
113 |
+
|
114 |
+
<?php if($archives){ ?>
|
115 |
+
<li> <a href="#"><span>Archives</span></a>
|
116 |
+
<ul>
|
117 |
+
<?php
|
118 |
+
$args = array();
|
119 |
+
wp_get_archives( $args ); ?>
|
120 |
+
</ul>
|
121 |
+
</li>
|
122 |
+
<?php } ?>
|
123 |
+
|
124 |
+
<?php do_action('dropdown_list_after'); ?>
|
125 |
+
|
126 |
+
<?php if($admin){ wp_register('<li class="admintab">','</li>'); } if($login){ ?><li class="page_item"><?php wp_loginout(); ?><?php } ?>
|
127 |
+
|
128 |
+
</ul></td>
|
129 |
+
</tr></table>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<?php do_action('dropdown_after'); ?>
|
133 |
+
|
134 |
+
</div>
|
135 |
+
<?php echo $after_widget; ?>
|
136 |
+
<?php
|
137 |
+
}
|
138 |
+
|
139 |
+
/** @see WP_Widget::update */
|
140 |
+
function update($new_instance, $old_instance) {
|
141 |
+
return $new_instance;
|
142 |
+
}
|
143 |
+
|
144 |
+
/** @see WP_Widget::form */
|
145 |
+
function form($instance) {
|
146 |
+
|
147 |
+
extract( $instance );
|
148 |
+
$widget_options = wp_parse_args( $instance, $this->defaults );
|
149 |
+
extract( $widget_options, EXTR_SKIP );
|
150 |
+
|
151 |
+
?>
|
152 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title (won\'t be shown):', 'shailan-dropdown-menu'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
|
153 |
+
|
154 |
+
<p> Includes: <br/>
|
155 |
+
|
156 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('home'); ?>" name="<?php echo $this->get_field_name('home'); ?>"<?php checked( (bool) $home ); ?> />
|
157 |
+
<label for="<?php echo $this->get_field_id('home'); ?>"><?php _e( 'Homepage link' , 'shailan-dropdown-menu' ); ?></label><br />
|
158 |
+
|
159 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('pages'); ?>" name="<?php echo $this->get_field_name('pages'); ?>"<?php checked( (bool) $pages ); ?> />
|
160 |
+
<label for="<?php echo $this->get_field_id('pages'); ?>"><?php _e( 'Pages' , 'shailan-dropdown-menu' ); ?></label><br />
|
161 |
+
|
162 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('categories'); ?>" name="<?php echo $this->get_field_name('categories'); ?>"<?php checked( (bool) $categories ); ?> />
|
163 |
+
<label for="<?php echo $this->get_field_id('categories'); ?>"><?php _e( 'Categories' , 'shailan-dropdown-menu' ); ?></label><br />
|
164 |
+
|
165 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('links'); ?>" name="<?php echo $this->get_field_name('links'); ?>"<?php checked( (bool) $links ); ?> />
|
166 |
+
<label for="<?php echo $this->get_field_id('links'); ?>"><?php _e( 'Links' , 'shailan-dropdown-menu' ); ?></label><br />
|
167 |
+
|
168 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('archives'); ?>" name="<?php echo $this->get_field_name('archives'); ?>"<?php checked( (bool) $archives ); ?> />
|
169 |
+
<label for="<?php echo $this->get_field_id('archives'); ?>"><?php _e( 'Archives' , 'shailan-dropdown-menu' ); ?></label><br />
|
170 |
+
|
171 |
+
|
172 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('login'); ?>" name="<?php echo $this->get_field_name('login'); ?>"<?php checked( (bool) $login ); ?> />
|
173 |
+
<label for="<?php echo $this->get_field_id('login'); ?>"><?php _e( 'Login/logout' , 'shailan-dropdown-menu' ); ?></label><br />
|
174 |
+
|
175 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('admin'); ?>" name="<?php echo $this->get_field_name('admin'); ?>"<?php checked( (bool) $admin ); ?> />
|
176 |
+
<label for="<?php echo $this->get_field_id('admin'); ?>"><?php _e( 'Register/Site Admin' , 'shailan-dropdown-menu' ); ?></label>
|
177 |
+
</p>
|
178 |
+
|
179 |
+
<p>
|
180 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('vertical'); ?>" name="<?php echo $this->get_field_name('vertical'); ?>"<?php checked( (bool) $vertical ); ?> />
|
181 |
+
<label for="<?php echo $this->get_field_id('vertical'); ?>"><?php _e( 'Vertical menu' , 'shailan-dropdown-menu' ); ?></label>
|
182 |
+
</p>
|
183 |
+
|
184 |
+
<p><?php _e('Align:', 'shailan-dropdown-menu'); ?> <label for="left"><input type="radio" id="left" name="<?php echo $this->get_field_name('align'); ?>" value="left" <?php if($align=='left'){ echo 'checked="checked"'; } ?> /> <?php _e('Left', 'shailan-dropdown-menu'); ?></label> <label for="center"><input type="radio" id="center" name="<?php echo $this->get_field_name('align'); ?>" value="center" <?php if($align=='center'){ echo 'checked="checked"'; } ?>/> <?php _e('Center', 'shailan-dropdown-menu'); ?></label> <label for="right"><input type="radio" id="right" name="<?php echo $this->get_field_name('align'); ?>" value="right" <?php if($align=='right'){ echo 'checked="checked"'; } ?>/> <?php _e('Right', 'shailan-dropdown-menu'); ?></label></p>
|
185 |
+
|
186 |
+
<br class="clear" />
|
187 |
+
|
188 |
+
<?php
|
189 |
+
}
|
190 |
+
|
191 |
+
} // class shailan_MultiDropDown
|
192 |
+
|
193 |
+
// register widget
|
194 |
+
function ddm_register_multi_widget(){
|
195 |
+
register_widget("shailan_MultiDropDown");
|
196 |
+
}
|
197 |
+
add_action('widgets_init', 'ddm_register_multi_widget' );
|
shailan-page-walker.php
CHANGED
@@ -1,111 +1,111 @@
|
|
1 |
-
<?php // is the love
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Create HTML dropdown list of pages WITHOUT A TITLE ATTRIBUTE.
|
5 |
-
*
|
6 |
-
* @package Shailan Dropdown Menu Widget
|
7 |
-
* @since 2.1.0
|
8 |
-
* @uses Walker
|
9 |
-
*/
|
10 |
-
class shailan_PageWalker extends Walker {
|
11 |
-
/**
|
12 |
-
* @see Walker::$tree_type
|
13 |
-
* @since 2.1.0
|
14 |
-
* @var string
|
15 |
-
*/
|
16 |
-
var $tree_type = 'page';
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @see Walker::$db_fields
|
20 |
-
* @since 2.1.0
|
21 |
-
* @todo Decouple this
|
22 |
-
* @var array
|
23 |
-
*/
|
24 |
-
var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @see Walker::start_lvl()
|
28 |
-
* @since 2.1.0
|
29 |
-
*
|
30 |
-
* @param string $output Passed by reference. Used to append additional content.
|
31 |
-
* @param int $depth Depth of page. Used for padding.
|
32 |
-
*/
|
33 |
-
function start_lvl( &$output, $depth = 0, $args = Array() ) {
|
34 |
-
$indent = str_repeat("\t", $depth);
|
35 |
-
$output .= "\n$indent<ul>\n";
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @see Walker::end_lvl()
|
40 |
-
* @since 2.1.0
|
41 |
-
*
|
42 |
-
* @param string $output Passed by reference. Used to append additional content.
|
43 |
-
* @param int $depth Depth of page. Used for padding.
|
44 |
-
*/
|
45 |
-
function end_lvl( &$output, $depth = 0, $args = Array() ) {
|
46 |
-
$indent = str_repeat("\t", $depth);
|
47 |
-
$output .= "$indent</ul>\n";
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* @see Walker::start_el()
|
52 |
-
* @since 2.1.0
|
53 |
-
*
|
54 |
-
* @param string $output Passed by reference. Used to append additional content.
|
55 |
-
* @param object $page Page data object.
|
56 |
-
* @param int $depth Depth of page in reference to parent pages. Used for padding.
|
57 |
-
* @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
|
58 |
-
*/
|
59 |
-
function start_el( &$output, $object, $depth = 0, $args = Array(), $current_object_id = 0 ) {
|
60 |
-
if ( $depth )
|
61 |
-
$indent = str_repeat("\t", $depth);
|
62 |
-
else
|
63 |
-
$indent = '';
|
64 |
-
|
65 |
-
$defaults = array(
|
66 |
-
'link_before' => '',
|
67 |
-
'link_after' => ''
|
68 |
-
);
|
69 |
-
|
70 |
-
$args = wp_parse_args( $args, $defaults );
|
71 |
-
extract($args, EXTR_SKIP);
|
72 |
-
|
73 |
-
$css_class = array('page_item', 'page-item-'.$page->ID);
|
74 |
-
if ( !empty($current_object_id) ) {
|
75 |
-
$_current_page = get_page( $current_object_id );
|
76 |
-
if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )
|
77 |
-
$css_class[] = 'current_page_ancestor';
|
78 |
-
if ( $page->ID == $current_object_id )
|
79 |
-
$css_class[] = 'current_page_item';
|
80 |
-
elseif ( $_current_page && $page->ID == $_current_page->post_parent )
|
81 |
-
$css_class[] = 'current_page_parent';
|
82 |
-
} elseif ( $page->ID == get_option('page_for_posts') ) {
|
83 |
-
$css_class[] = 'current_page_parent';
|
84 |
-
}
|
85 |
-
|
86 |
-
$css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
|
87 |
-
|
88 |
-
$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" ><span>' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</span></a>';
|
89 |
-
|
90 |
-
if ( !empty($show_date) ) {
|
91 |
-
if ( 'modified' == $show_date )
|
92 |
-
$time = $page->post_modified;
|
93 |
-
else
|
94 |
-
$time = $page->post_date;
|
95 |
-
|
96 |
-
$output .= " " . mysql2date($date_format, $time);
|
97 |
-
}
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* @see Walker::end_el()
|
102 |
-
* @since 2.1.0
|
103 |
-
*
|
104 |
-
* @param string $output Passed by reference. Used to append additional content.
|
105 |
-
* @param object $page Page data object. Not used.
|
106 |
-
* @param int $depth Depth of page. Not Used.
|
107 |
-
*/
|
108 |
-
function end_el( &$output, $object, $depth = 0, $args = Array() ) {
|
109 |
-
$output .= "</li>\n";
|
110 |
-
}
|
111 |
}
|
1 |
+
<?php // is the love
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Create HTML dropdown list of pages WITHOUT A TITLE ATTRIBUTE.
|
5 |
+
*
|
6 |
+
* @package Shailan Dropdown Menu Widget
|
7 |
+
* @since 2.1.0
|
8 |
+
* @uses Walker
|
9 |
+
*/
|
10 |
+
class shailan_PageWalker extends Walker {
|
11 |
+
/**
|
12 |
+
* @see Walker::$tree_type
|
13 |
+
* @since 2.1.0
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
var $tree_type = 'page';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @see Walker::$db_fields
|
20 |
+
* @since 2.1.0
|
21 |
+
* @todo Decouple this
|
22 |
+
* @var array
|
23 |
+
*/
|
24 |
+
var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @see Walker::start_lvl()
|
28 |
+
* @since 2.1.0
|
29 |
+
*
|
30 |
+
* @param string $output Passed by reference. Used to append additional content.
|
31 |
+
* @param int $depth Depth of page. Used for padding.
|
32 |
+
*/
|
33 |
+
function start_lvl( &$output, $depth = 0, $args = Array() ) {
|
34 |
+
$indent = str_repeat("\t", $depth);
|
35 |
+
$output .= "\n$indent<ul>\n";
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @see Walker::end_lvl()
|
40 |
+
* @since 2.1.0
|
41 |
+
*
|
42 |
+
* @param string $output Passed by reference. Used to append additional content.
|
43 |
+
* @param int $depth Depth of page. Used for padding.
|
44 |
+
*/
|
45 |
+
function end_lvl( &$output, $depth = 0, $args = Array() ) {
|
46 |
+
$indent = str_repeat("\t", $depth);
|
47 |
+
$output .= "$indent</ul>\n";
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @see Walker::start_el()
|
52 |
+
* @since 2.1.0
|
53 |
+
*
|
54 |
+
* @param string $output Passed by reference. Used to append additional content.
|
55 |
+
* @param object $page Page data object.
|
56 |
+
* @param int $depth Depth of page in reference to parent pages. Used for padding.
|
57 |
+
* @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
|
58 |
+
*/
|
59 |
+
function start_el( &$output, $object, $depth = 0, $args = Array(), $current_object_id = 0 ) {
|
60 |
+
if ( $depth )
|
61 |
+
$indent = str_repeat("\t", $depth);
|
62 |
+
else
|
63 |
+
$indent = '';
|
64 |
+
|
65 |
+
$defaults = array(
|
66 |
+
'link_before' => '',
|
67 |
+
'link_after' => ''
|
68 |
+
);
|
69 |
+
|
70 |
+
$args = wp_parse_args( $args, $defaults );
|
71 |
+
extract($args, EXTR_SKIP);
|
72 |
+
|
73 |
+
$css_class = array('page_item', 'page-item-'.$page->ID);
|
74 |
+
if ( !empty($current_object_id) ) {
|
75 |
+
$_current_page = get_page( $current_object_id );
|
76 |
+
if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )
|
77 |
+
$css_class[] = 'current_page_ancestor';
|
78 |
+
if ( $page->ID == $current_object_id )
|
79 |
+
$css_class[] = 'current_page_item';
|
80 |
+
elseif ( $_current_page && $page->ID == $_current_page->post_parent )
|
81 |
+
$css_class[] = 'current_page_parent';
|
82 |
+
} elseif ( $page->ID == get_option('page_for_posts') ) {
|
83 |
+
$css_class[] = 'current_page_parent';
|
84 |
+
}
|
85 |
+
|
86 |
+
$css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
|
87 |
+
|
88 |
+
$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" ><span>' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</span></a>';
|
89 |
+
|
90 |
+
if ( !empty($show_date) ) {
|
91 |
+
if ( 'modified' == $show_date )
|
92 |
+
$time = $page->post_modified;
|
93 |
+
else
|
94 |
+
$time = $page->post_date;
|
95 |
+
|
96 |
+
$output .= " " . mysql2date($date_format, $time);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @see Walker::end_el()
|
102 |
+
* @since 2.1.0
|
103 |
+
*
|
104 |
+
* @param string $output Passed by reference. Used to append additional content.
|
105 |
+
* @param object $page Page data object. Not used.
|
106 |
+
* @param int $depth Depth of page. Not Used.
|
107 |
+
*/
|
108 |
+
function end_el( &$output, $object, $depth = 0, $args = Array() ) {
|
109 |
+
$output .= "</li>\n";
|
110 |
+
}
|
111 |
}
|
shailan.DropDownMenu.php
CHANGED
@@ -1,829 +1,821 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Dropdown Menu Widget
|
4 |
-
Plugin URI:
|
5 |
-
Description: Highly customizable automatic pages, categories or custom dropdown navigation menu widget with nice jQuery effects.
|
6 |
-
Tags: dropdown, menu, css, css-dropdown, navigation, widget, dropdown-menu, customization, theme, jquery, template, multi-color, theme
|
7 |
-
Version: 1.9.
|
8 |
-
Author: Metin Saylan
|
9 |
-
Author URI:
|
10 |
-
Text Domain: shailan-dropdown-menu
|
11 |
-
*/
|
12 |
-
|
13 |
-
define('VERSION', '1.9.
|
14 |
-
|
15 |
-
class shailan_DropdownWidget extends WP_Widget {
|
16 |
-
|
17 |
-
public function __construct() {
|
18 |
-
$widget_ops = array(
|
19 |
-
'classname' => 'shailan-dropdown-menu-widget',
|
20 |
-
'description' => __( 'Dropdown page/category/custom menu', 'shailan-dropdown-menu' )
|
21 |
-
);
|
22 |
-
|
23 |
-
parent::__construct(
|
24 |
-
'dropdown-menu',
|
25 |
-
__('Dropdown Menu', 'shailan-dropdown-menu'),
|
26 |
-
$widget_ops
|
27 |
-
);
|
28 |
-
|
29 |
-
$this->alt_option_name = 'widget_dropdown_menu';
|
30 |
-
|
31 |
-
$this->pluginname = "Dropdown Menu";
|
32 |
-
$this->shortname = "shailan_dm";
|
33 |
-
|
34 |
-
$this->help_url = "
|
35 |
-
|
36 |
-
$this->version = VERSION;
|
37 |
-
$this->settings_key = "shailan_dropdown_menu";
|
38 |
-
$this->options_page = "dropdown-menu";
|
39 |
-
|
40 |
-
// Hook up styles
|
41 |
-
add_action( 'wp_head', array(&$this, 'header') );
|
42 |
-
|
43 |
-
// Hook up scripts
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
// Include options array
|
49 |
-
require_once("shailan-dropdown-menu-options.php");
|
50 |
-
$this->options = $options;
|
51 |
-
$this->settings = $this->get_plugin_settings();
|
52 |
-
|
53 |
-
$this->widget_defaults = array(
|
54 |
-
'title' => '',
|
55 |
-
'type' => 'pages',
|
56 |
-
'exclude' => '',
|
57 |
-
'home' => false,
|
58 |
-
'login' => false,
|
59 |
-
'admin' => false,
|
60 |
-
'vertical' => false,
|
61 |
-
'align' => 'left',
|
62 |
-
'theme' => 'none',
|
63 |
-
'show_title' => false,
|
64 |
-
'width' => 'empty'
|
65 |
-
);
|
66 |
-
|
67 |
-
add_action('admin_menu', array( &$this, 'admin_header') );
|
68 |
-
}
|
69 |
-
|
70 |
-
function admin_header(){
|
71 |
-
|
72 |
-
if ( @$_GET['page'] == $this->options_page ) {
|
73 |
-
|
74 |
-
// Options page styles
|
75 |
-
wp_enqueue_style( 'farbtastic' );
|
76 |
-
wp_enqueue_style( "dropdown-admin", plugins_url( '/css/dropdown-admin.css' , __FILE__ ) , false, "1.0", "all");
|
77 |
-
|
78 |
-
// Options page scripts
|
79 |
-
wp_enqueue_script( "jquery" );
|
80 |
-
wp_enqueue_script( 'farbtastic' );
|
81 |
-
wp_enqueue_script( 'dropdown-colorpick', plugins_url( '/scripts/admin.js' , __FILE__ ) , array('jquery') );
|
82 |
-
|
83 |
-
if ( @$_REQUEST['action'] && 'save' == $_REQUEST['action'] ) {
|
84 |
-
|
85 |
-
// Save settings
|
86 |
-
$settings = $this->get_settings();
|
87 |
-
|
88 |
-
// Set updated values
|
89 |
-
foreach($this->options as $option){
|
90 |
-
if( array_key_exists( 'id', $option ) ){
|
91 |
-
if( $option['type'] == 'checkbox' && empty( $_REQUEST[ $option['id'] ] ) ) {
|
92 |
-
$settings[ $option['id'] ] = 'off';
|
93 |
-
} else {
|
94 |
-
$settings[ $option['id'] ] = $_REQUEST[ $option['id'] ];
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
// Save the settings
|
100 |
-
update_option( $this->settings_key, $settings );
|
101 |
-
header("Location: admin.php?page=" . $this->options_page . "&saved=true&message=1");
|
102 |
-
die;
|
103 |
-
} else if( @$_REQUEST['action'] && 'reset' == $_REQUEST['action'] ) {
|
104 |
-
|
105 |
-
// Start a new settings array
|
106 |
-
$settings = array();
|
107 |
-
delete_option( $this->settings_key );
|
108 |
-
|
109 |
-
header("Location: admin.php?page=" . $this->options_page . "&reset=true&message=2");
|
110 |
-
die;
|
111 |
-
}
|
112 |
-
|
113 |
-
}
|
114 |
-
|
115 |
-
$page = add_options_page(
|
116 |
-
__('Settings for Dropdown Menu', 'shailan-dropdown-menu'),
|
117 |
-
__('Dropdown Menu', 'shailan-dropdown-menu'),
|
118 |
-
'
|
119 |
-
$this->options_page,
|
120 |
-
array( &$this, 'options_page')
|
121 |
-
);
|
122 |
-
|
123 |
-
add_action( 'admin_print_styles-' . $page, array( &$this, 'header' ) );
|
124 |
-
}
|
125 |
-
|
126 |
-
function get_plugin_settings(){
|
127 |
-
$settings = get_option( $this->settings_key );
|
128 |
-
|
129 |
-
if(FALSE === $settings){
|
130 |
-
// Options doesn't exist, install standard settings
|
131 |
-
return $this->install_default_settings();
|
132 |
-
} else { // Options exist, update if necessary
|
133 |
-
if( !empty( $settings['version'] ) ){ $ver = $settings['version']; }
|
134 |
-
else { $ver = ''; }
|
135 |
-
|
136 |
-
if($ver != $this->version){
|
137 |
-
// Update settings
|
138 |
-
return $this->update_plugin_settings( $settings );
|
139 |
-
} else {
|
140 |
-
// Plugin is up to date, let's return
|
141 |
-
return $settings;
|
142 |
-
}
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
/* Updates a single option key */
|
147 |
-
function update_plugin_setting( $key, $value ){
|
148 |
-
$settings = $this->get_plugin_settings();
|
149 |
-
$settings[$key] = $value;
|
150 |
-
update_option( $this->settings_key, $settings );
|
151 |
-
}
|
152 |
-
|
153 |
-
/* Retrieves a single option */
|
154 |
-
function get_plugin_setting( $key, $default = '' ) {
|
155 |
-
$settings = $this->get_plugin_settings();
|
156 |
-
if( array_key_exists($key, $settings) ){
|
157 |
-
return $settings[$key];
|
158 |
-
} else {
|
159 |
-
return $default;
|
160 |
-
}
|
161 |
-
|
162 |
-
return FALSE;
|
163 |
-
}
|
164 |
-
|
165 |
-
function install_default_settings(){
|
166 |
-
// Create settings array
|
167 |
-
$settings = array();
|
168 |
-
|
169 |
-
// Set default values
|
170 |
-
foreach($this->options as $option){
|
171 |
-
if( array_key_exists( 'id', $option ) && array_key_exists( 'std', $option ) )
|
172 |
-
$settings[ $option['id'] ] = $option['std'];
|
173 |
-
}
|
174 |
-
|
175 |
-
$settings['version'] = $this->version;
|
176 |
-
// Save the settings
|
177 |
-
update_option( $this->settings_key, $settings );
|
178 |
-
return $settings;
|
179 |
-
}
|
180 |
-
|
181 |
-
function update_plugin_settings( $current_settings ){
|
182 |
-
//Add missing keys
|
183 |
-
foreach($this->options as $option){
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
$
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
$
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
$
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
$home_item
|
263 |
-
|
264 |
-
|
265 |
-
$
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
$
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
echo $
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
echo $
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
}
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
'
|
362 |
-
'
|
363 |
-
'
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
echo $
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
$
|
402 |
-
$
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
<
|
414 |
-
|
415 |
-
<p><label for="<?php echo $this->get_field_id('
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
<
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
<p
|
429 |
-
<
|
430 |
-
|
431 |
-
<
|
432 |
-
<
|
433 |
-
|
434 |
-
<
|
435 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('
|
436 |
-
<label for="<?php echo $this->get_field_id('
|
437 |
-
|
438 |
-
|
439 |
-
<
|
440 |
-
<label for="
|
441 |
-
<
|
442 |
-
<label for="
|
443 |
-
|
444 |
-
|
445 |
-
<p><?php _e('
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
'
|
456 |
-
'
|
457 |
-
'
|
458 |
-
'
|
459 |
-
'
|
460 |
-
'
|
461 |
-
'
|
462 |
-
'
|
463 |
-
'
|
464 |
-
'
|
465 |
-
'
|
466 |
-
'
|
467 |
-
'
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
$
|
499 |
-
$
|
500 |
-
$
|
501 |
-
|
502 |
-
$
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
if(
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
if( $
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
case "
|
552 |
-
$posvert =
|
553 |
-
break;
|
554 |
-
case "
|
555 |
-
$posvert = -
|
556 |
-
break;
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
.shailan-dropdown-menu .dropdown-horizontal-container,
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
ul.dropdown a:
|
576 |
-
|
577 |
-
|
578 |
-
ul.dropdown li
|
579 |
-
ul.dropdown a
|
580 |
-
|
581 |
-
ul.dropdown
|
582 |
-
ul.dropdown li
|
583 |
-
|
584 |
-
|
585 |
-
ul.dropdown
|
586 |
-
|
587 |
-
|
588 |
-
ul.dropdown ul
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
ul.dropdown li.parent
|
619 |
-
|
620 |
-
|
621 |
-
ul.dropdown li
|
622 |
-
content:"";position:absolute;top:
|
623 |
-
border-
|
624 |
-
ul.dropdown li
|
625 |
-
content:"";position:absolute;top:
|
626 |
-
border-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
$
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
}
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
$
|
776 |
-
|
777 |
-
$
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
'
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
return $args;
|
823 |
-
} add_filter('wp_nav_menu_args', 'shailan_nav_menu_args_filter', 90, 1);
|
824 |
-
|
825 |
-
/*
|
826 |
-
function shailan_nav_menu_output_filter( $nav_menu, $args ){
|
827 |
-
return $nav_menu;
|
828 |
-
} add_filter( 'wp_nav_menu', 'shailan_nav_menu_output_filter', 10, 2);
|
829 |
-
*/
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Dropdown Menu Widget
|
4 |
+
Plugin URI: https://metinsaylan.com/wordpress/plugins/dropdown-menu/
|
5 |
+
Description: Highly customizable automatic pages, categories or custom dropdown navigation menu widget with nice jQuery effects.
|
6 |
+
Tags: dropdown, menu, css, css-dropdown, navigation, widget, dropdown-menu, customization, theme, jquery, template, multi-color, theme
|
7 |
+
Version: 1.9.7
|
8 |
+
Author: Metin Saylan
|
9 |
+
Author URI: https://metinsaylan.com/
|
10 |
+
Text Domain: shailan-dropdown-menu
|
11 |
+
*/
|
12 |
+
|
13 |
+
define('VERSION', '1.9.7');
|
14 |
+
|
15 |
+
class shailan_DropdownWidget extends WP_Widget {
|
16 |
+
|
17 |
+
public function __construct() {
|
18 |
+
$widget_ops = array(
|
19 |
+
'classname' => 'shailan-dropdown-menu-widget',
|
20 |
+
'description' => __( 'Dropdown page/category/custom menu', 'shailan-dropdown-menu' )
|
21 |
+
);
|
22 |
+
|
23 |
+
parent::__construct(
|
24 |
+
'dropdown-menu',
|
25 |
+
__('Dropdown Menu', 'shailan-dropdown-menu'),
|
26 |
+
$widget_ops
|
27 |
+
);
|
28 |
+
|
29 |
+
$this->alt_option_name = 'widget_dropdown_menu';
|
30 |
+
|
31 |
+
$this->pluginname = "Dropdown Menu";
|
32 |
+
$this->shortname = "shailan_dm";
|
33 |
+
|
34 |
+
$this->help_url = "https://metinsaylan.com/wordpress/plugins/dropdown-menu/help/";
|
35 |
+
|
36 |
+
$this->version = VERSION;
|
37 |
+
$this->settings_key = "shailan_dropdown_menu";
|
38 |
+
$this->options_page = "dropdown-menu";
|
39 |
+
|
40 |
+
// Hook up styles
|
41 |
+
add_action( 'wp_head', array(&$this, 'header') );
|
42 |
+
|
43 |
+
// Hook up scripts
|
44 |
+
wp_enqueue_script( 'jquery' );
|
45 |
+
wp_enqueue_script( 'hoverIntent', plugins_url( '/scripts/hoverIntent.js' , __FILE__ ) , array('jquery') );
|
46 |
+
wp_enqueue_script( 'dropdown-ie-support', plugins_url( '/scripts/include.js' , __FILE__ ) , array('jquery') );
|
47 |
+
|
48 |
+
// Include options array
|
49 |
+
require_once("shailan-dropdown-menu-options.php");
|
50 |
+
$this->options = $options;
|
51 |
+
$this->settings = $this->get_plugin_settings();
|
52 |
+
|
53 |
+
$this->widget_defaults = array(
|
54 |
+
'title' => '',
|
55 |
+
'type' => 'pages',
|
56 |
+
'exclude' => '',
|
57 |
+
'home' => false,
|
58 |
+
'login' => false,
|
59 |
+
'admin' => false,
|
60 |
+
'vertical' => false,
|
61 |
+
'align' => 'left',
|
62 |
+
'theme' => 'none',
|
63 |
+
'show_title' => false,
|
64 |
+
'width' => 'empty'
|
65 |
+
);
|
66 |
+
|
67 |
+
add_action('admin_menu', array( &$this, 'admin_header') );
|
68 |
+
}
|
69 |
+
|
70 |
+
function admin_header(){
|
71 |
+
|
72 |
+
if ( @$_GET['page'] == $this->options_page ) {
|
73 |
+
|
74 |
+
// Options page styles
|
75 |
+
wp_enqueue_style( 'farbtastic' );
|
76 |
+
wp_enqueue_style( "dropdown-admin", plugins_url( '/css/dropdown-admin.css' , __FILE__ ) , false, "1.0", "all");
|
77 |
+
|
78 |
+
// Options page scripts
|
79 |
+
wp_enqueue_script( "jquery" );
|
80 |
+
wp_enqueue_script( 'farbtastic' );
|
81 |
+
wp_enqueue_script( 'dropdown-colorpick', plugins_url( '/scripts/admin.js' , __FILE__ ) , array('jquery') );
|
82 |
+
|
83 |
+
if ( @$_REQUEST['action'] && 'save' == $_REQUEST['action'] ) {
|
84 |
+
|
85 |
+
// Save settings
|
86 |
+
$settings = $this->get_settings();
|
87 |
+
|
88 |
+
// Set updated values
|
89 |
+
foreach($this->options as $option){
|
90 |
+
if( array_key_exists( 'id', $option ) ){
|
91 |
+
if( $option['type'] == 'checkbox' && empty( $_REQUEST[ $option['id'] ] ) ) {
|
92 |
+
$settings[ $option['id'] ] = 'off';
|
93 |
+
} else {
|
94 |
+
$settings[ $option['id'] ] = $_REQUEST[ $option['id'] ];
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
// Save the settings
|
100 |
+
update_option( $this->settings_key, $settings );
|
101 |
+
header("Location: admin.php?page=" . $this->options_page . "&saved=true&message=1");
|
102 |
+
die;
|
103 |
+
} else if( @$_REQUEST['action'] && 'reset' == $_REQUEST['action'] ) {
|
104 |
+
|
105 |
+
// Start a new settings array
|
106 |
+
$settings = array();
|
107 |
+
delete_option( $this->settings_key );
|
108 |
+
|
109 |
+
header("Location: admin.php?page=" . $this->options_page . "&reset=true&message=2");
|
110 |
+
die;
|
111 |
+
}
|
112 |
+
|
113 |
+
}
|
114 |
+
|
115 |
+
$page = add_options_page(
|
116 |
+
__('Settings for Dropdown Menu', 'shailan-dropdown-menu'),
|
117 |
+
__('Dropdown Menu', 'shailan-dropdown-menu'),
|
118 |
+
'manage_options',
|
119 |
+
$this->options_page,
|
120 |
+
array( &$this, 'options_page')
|
121 |
+
);
|
122 |
+
|
123 |
+
add_action( 'admin_print_styles-' . $page, array( &$this, 'header' ) );
|
124 |
+
}
|
125 |
+
|
126 |
+
function get_plugin_settings(){
|
127 |
+
$settings = get_option( $this->settings_key );
|
128 |
+
|
129 |
+
if(FALSE === $settings){
|
130 |
+
// Options doesn't exist, install standard settings
|
131 |
+
return $this->install_default_settings();
|
132 |
+
} else { // Options exist, update if necessary
|
133 |
+
if( !empty( $settings['version'] ) ){ $ver = $settings['version']; }
|
134 |
+
else { $ver = ''; }
|
135 |
+
|
136 |
+
if($ver != $this->version){
|
137 |
+
// Update settings
|
138 |
+
return $this->update_plugin_settings( $settings );
|
139 |
+
} else {
|
140 |
+
// Plugin is up to date, let's return
|
141 |
+
return $settings;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
/* Updates a single option key */
|
147 |
+
function update_plugin_setting( $key, $value ){
|
148 |
+
$settings = $this->get_plugin_settings();
|
149 |
+
$settings[$key] = $value;
|
150 |
+
update_option( $this->settings_key, $settings );
|
151 |
+
}
|
152 |
+
|
153 |
+
/* Retrieves a single option */
|
154 |
+
function get_plugin_setting( $key, $default = '' ) {
|
155 |
+
$settings = $this->get_plugin_settings();
|
156 |
+
if( array_key_exists($key, $settings) ){
|
157 |
+
return $settings[$key];
|
158 |
+
} else {
|
159 |
+
return $default;
|
160 |
+
}
|
161 |
+
|
162 |
+
return FALSE;
|
163 |
+
}
|
164 |
+
|
165 |
+
function install_default_settings(){
|
166 |
+
// Create settings array
|
167 |
+
$settings = array();
|
168 |
+
|
169 |
+
// Set default values
|
170 |
+
foreach($this->options as $option){
|
171 |
+
if( array_key_exists( 'id', $option ) && array_key_exists( 'std', $option ) )
|
172 |
+
$settings[ $option['id'] ] = $option['std'];
|
173 |
+
}
|
174 |
+
|
175 |
+
$settings['version'] = $this->version;
|
176 |
+
// Save the settings
|
177 |
+
update_option( $this->settings_key, $settings );
|
178 |
+
return $settings;
|
179 |
+
}
|
180 |
+
|
181 |
+
function update_plugin_settings( $current_settings ){
|
182 |
+
//Add missing keys
|
183 |
+
foreach($this->options as $option){
|
184 |
+
|
185 |
+
if( array_key_exists ( 'id' , $option ) ){
|
186 |
+
|
187 |
+
// If this option has a default value
|
188 |
+
if( array_key_exists( 'std', $option ) && !array_key_exists( $option['id'], $current_settings ) ){
|
189 |
+
$current_settings[ $option['id'] ] = $option['std'];
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
update_option( $this->settings_key, $current_settings );
|
196 |
+
return $current_settings;
|
197 |
+
}
|
198 |
+
|
199 |
+
function options_page(){
|
200 |
+
global $options, $current;
|
201 |
+
|
202 |
+
$title = "Dropdown Menu Widget Options";
|
203 |
+
|
204 |
+
$options = $this->options;
|
205 |
+
$current = $this->get_plugin_settings();
|
206 |
+
|
207 |
+
$messages = array(
|
208 |
+
"1" => __("Dropdown Menu Widget settings are saved.", "shailan-dropdown-menu"),
|
209 |
+
"2" => __("Dropdown Menu Widget settings are reset.", "shailan-dropdown-menu")
|
210 |
+
);
|
211 |
+
|
212 |
+
$navigation = '<div id="stf_nav"><a href="https://metinsaylan.com/wordpress/plugins/dropdown-menu/" target="_blank">Plugin page</a> | <a href="https://metinsaylan.com/wordpress/plugins/dropdown-menu/help/" target="_blank">Usage</a> | <a href="https://metinsaylan.com/donate/" target="_blank">Donate</a> | <a href="https://metinsaylan.com/wordpress/plugins/" target="_blank">Get more plugins..</a></div>';
|
213 |
+
|
214 |
+
$footer_text = '';
|
215 |
+
|
216 |
+
include_once( "stf-page-options.php" );
|
217 |
+
|
218 |
+
}
|
219 |
+
|
220 |
+
/******************************************************************************
|
221 |
+
* the WIDGET
|
222 |
+
******************************************************************************/
|
223 |
+
function widget($args, $instance) {
|
224 |
+
extract( $args );
|
225 |
+
$widget_options = wp_parse_args( $instance, $this->widget_defaults );
|
226 |
+
extract( $widget_options, EXTR_SKIP );
|
227 |
+
|
228 |
+
// On and off
|
229 |
+
$show_title = (bool) ( 'on' == $show_title );
|
230 |
+
$orientation = ( (bool) ( 'on' == $vertical) ? 'dropdown-vertical' : 'dropdown-horizontal');
|
231 |
+
$custom_walkers = false; // (bool) get_option('shailan_dm_customwalkers'); disabled
|
232 |
+
$show_empty = (bool) ( 'on' == $this->get_plugin_setting('shailan_dm_show_empty') );
|
233 |
+
|
234 |
+
$width = (int) $width;
|
235 |
+
|
236 |
+
$width_attr = '';
|
237 |
+
if( $width > 0 )
|
238 |
+
$width_attr = 'style="width:' . $width . 'px;"';
|
239 |
+
|
240 |
+
if( !isset($align) || $align == '') {
|
241 |
+
$align = 'left';
|
242 |
+
}
|
243 |
+
|
244 |
+
if( !isset($type) || $type == '') {
|
245 |
+
$type = 'pages';
|
246 |
+
}
|
247 |
+
|
248 |
+
echo $args['before_widget'];
|
249 |
+
|
250 |
+
// Show title if option checked
|
251 |
+
if ( $title && $show_title ){ echo $before_title . $title . $after_title; }
|
252 |
+
|
253 |
+
$nl = "\n"; $indent = "\n\t"; $indent2 = "\n\t\t";
|
254 |
+
|
255 |
+
echo $nl . "<div class=\"shailan-dropdown-menu\" >";
|
256 |
+
$dropdown_wrapper_open = $nl . '<div id="shailan-dropdown-wrapper-' . $this->number . '" >';
|
257 |
+
$dropdown_open = $indent . '<div align="'.$align.'" class="'.$orientation.'-container dm-align-'.$align.' clearfix"><div class="menu-alignment-wrap">';
|
258 |
+
$list_open = $indent2 . '<ul id="dropdown-'. $this->number .'" class="dropdown dropdown-'. $this->number .' '. $orientation . ' dropdown-align-'.$align.'" '. $width_attr .' >' . $nl . "<!-- Menu elements start -->\n";
|
259 |
+
|
260 |
+
if($home && ($type == 'pages' || $type == 'categories')){
|
261 |
+
|
262 |
+
$home_item = $nl . '<li class="page_item cat-item blogtab '. (is_front_page() && !is_paged() ? 'current_page_item current-cat' : '' ) . '">
|
263 |
+
<a href="'.get_option('home').'">';
|
264 |
+
|
265 |
+
$home_tag = $this->get_plugin_setting('shailan_dm_home_tag');
|
266 |
+
if(empty($home_tag)){ $home_tag = __('Home'); }
|
267 |
+
|
268 |
+
$home_item .= $home_tag;
|
269 |
+
$home_item .= '</a></li>';
|
270 |
+
|
271 |
+
$list_open .= $home_item;
|
272 |
+
}
|
273 |
+
|
274 |
+
$list_close = ($admin ? wp_register('<li class="admintab">','</li>', false) : '') . ($login ? '<li class="page_item">'. wp_loginout('', false) . '</li>' : '') . '
|
275 |
+
</ul>';
|
276 |
+
|
277 |
+
$dropdown_close = '</div></div>';
|
278 |
+
$dropdown_wrapper_close = '</div> ';
|
279 |
+
|
280 |
+
$menu_defaults = array(
|
281 |
+
'ID' => $this->number,
|
282 |
+
'sort_column' => 'menu_order, post_title',
|
283 |
+
'order_by' => 'name',
|
284 |
+
'depth' => '4',
|
285 |
+
'title_li' => '',
|
286 |
+
'exclude' => $exclude
|
287 |
+
);
|
288 |
+
|
289 |
+
$menu_defaults = apply_filters( 'dropdown_menu_defaults', $menu_defaults );
|
290 |
+
|
291 |
+
switch ( $type ) {
|
292 |
+
|
293 |
+
/** Pages menu */
|
294 |
+
case "pages":
|
295 |
+
|
296 |
+
if($custom_walkers){
|
297 |
+
$page_walker = new shailan_PageWalker();
|
298 |
+
$menu_defaults = wp_parse_args( array('walker'=>$page_walker) , $menu_defaults ); }
|
299 |
+
|
300 |
+
echo $dropdown_wrapper_open;
|
301 |
+
do_action('dropdown_before');
|
302 |
+
echo $dropdown_open;
|
303 |
+
echo $list_open;
|
304 |
+
do_action('dropdown_list_before');
|
305 |
+
wp_list_pages($menu_defaults);
|
306 |
+
do_action('dropdown_list_after');
|
307 |
+
echo $list_close;
|
308 |
+
echo $dropdown_close;
|
309 |
+
do_action('dropdown_after');
|
310 |
+
echo $dropdown_wrapper_close;
|
311 |
+
|
312 |
+
break;
|
313 |
+
|
314 |
+
/** Categories menu */
|
315 |
+
case "categories":
|
316 |
+
|
317 |
+
if($custom_walkers){
|
318 |
+
$cat_walker = new shailan_CategoryWalker();
|
319 |
+
$menu_defaults = wp_parse_args( array('walker'=>$cat_walker) , $menu_defaults ); }
|
320 |
+
|
321 |
+
if($show_empty){$menu_defaults = wp_parse_args( array('hide_empty'=>'0') , $menu_defaults ); }
|
322 |
+
|
323 |
+
echo $dropdown_wrapper_open;
|
324 |
+
do_action('dropdown_before');
|
325 |
+
echo $dropdown_open;
|
326 |
+
echo $list_open;
|
327 |
+
do_action('dropdown_list_before');
|
328 |
+
wp_list_categories($menu_defaults);
|
329 |
+
do_action('dropdown_list_after');
|
330 |
+
echo $list_close;
|
331 |
+
echo $dropdown_close;
|
332 |
+
do_action('dropdown_after');
|
333 |
+
echo $dropdown_wrapper_close;
|
334 |
+
|
335 |
+
break;
|
336 |
+
|
337 |
+
/** WP3 Nav menu */
|
338 |
+
default:
|
339 |
+
|
340 |
+
$location = '';
|
341 |
+
$menu = '';
|
342 |
+
|
343 |
+
// Replace navmenu_
|
344 |
+
if( FALSE !== strpos( $type, 'navmenu_' ) ){
|
345 |
+
$type = str_replace( 'navmenu_', '', $type );
|
346 |
+
}
|
347 |
+
|
348 |
+
$menu_id = $type;
|
349 |
+
|
350 |
+
// Check if a menu exists with this id
|
351 |
+
$menu = wp_get_nav_menu_object( $menu_id );
|
352 |
+
if( $menu ){ $menu = $menu_id; }
|
353 |
+
|
354 |
+
// Is that a location?
|
355 |
+
if ( ! $menu && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_id ] ) ){
|
356 |
+
$location = $menu_id;
|
357 |
+
$menu = '';
|
358 |
+
}
|
359 |
+
|
360 |
+
$menu_args = array(
|
361 |
+
'menu' => $menu,
|
362 |
+
'container' => false,
|
363 |
+
'container_class' => '',
|
364 |
+
'container_id' => '',
|
365 |
+
'menu_class' => 'dropdown '. $orientation . ' dropdown-align-'.$align,
|
366 |
+
'menu_id' => '',
|
367 |
+
'echo' => true,
|
368 |
+
'theme_location' => $location,
|
369 |
+
'is_shailan_dropdown_callback' => 'yes'
|
370 |
+
);
|
371 |
+
|
372 |
+
if($custom_walkers){
|
373 |
+
$page_walker = new shailan_PageWalker();
|
374 |
+
$menu_args = wp_parse_args( array('walker'=>$page_walker) , $menu_args );
|
375 |
+
}
|
376 |
+
|
377 |
+
//echo $dropdown_wrapper_open;
|
378 |
+
//do_action('dropdown_before');
|
379 |
+
//echo $dropdown_open;
|
380 |
+
wp_nav_menu( $menu_args );
|
381 |
+
//echo $dropdown_close;
|
382 |
+
//do_action('dropdown_after');
|
383 |
+
//echo $dropdown_wrapper_close;
|
384 |
+
|
385 |
+
} // switch ($type)
|
386 |
+
|
387 |
+
echo $nl . "</div>"; ?>
|
388 |
+
<?php echo $after_widget; $this->footer(); ?>
|
389 |
+
<?php
|
390 |
+
}
|
391 |
+
|
392 |
+
function update($new_instance, $old_instance) {
|
393 |
+
return $new_instance;
|
394 |
+
}
|
395 |
+
|
396 |
+
/******************************************************************************
|
397 |
+
* WIDGET FORM
|
398 |
+
******************************************************************************/
|
399 |
+
function form($instance) {
|
400 |
+
|
401 |
+
$widget_options = wp_parse_args( $instance, $this->widget_defaults );
|
402 |
+
extract( $widget_options, EXTR_SKIP );
|
403 |
+
|
404 |
+
$width = (int) $width;
|
405 |
+
$show_title = (bool) $show_title;
|
406 |
+
$home = (bool) $home;
|
407 |
+
$login = (bool) $login;
|
408 |
+
$admin = (bool) $admin;
|
409 |
+
$vertical = (bool) $vertical;
|
410 |
+
|
411 |
+
?>
|
412 |
+
|
413 |
+
<style type="text/css">.help-link{ padding:2px 5px; text-decoration:none; }</style>
|
414 |
+
|
415 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title :', 'shailan-dropdown-menu'); ?> <?php $this->help_link('widget-title'); ?><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label> </p>
|
416 |
+
|
417 |
+
<p>
|
418 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_title'); ?>" name="<?php echo $this->get_field_name('show_title'); ?>"<?php checked( $show_title ); ?> />
|
419 |
+
<label for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e( 'Show widget title' , 'shailan-dropdown-menu' ); ?></label><?php $this->help_link('show-title'); ?> <br />
|
420 |
+
|
421 |
+
<p><label for="<?php echo $this->get_field_id('type'); ?>"><?php _e('Menu Type:'); ?>
|
422 |
+
<select name="<?php echo $this->get_field_name('type'); ?>" id="<?php echo $this->get_field_id('type'); ?>">
|
423 |
+
<?php foreach ($this->menu_types as $key=>$option) { ?>
|
424 |
+
<option <?php if ($type == $key) { echo 'selected="selected"'; } ?> value="<?php echo $key; ?>"><?php echo $option; ?></option><?php } ?>
|
425 |
+
</select>
|
426 |
+
</label><?php $this->help_link('widget-menu-type'); ?> </p>
|
427 |
+
|
428 |
+
<p><label for="<?php echo $this->get_field_id('exclude'); ?>"><?php _e('Exclude:', 'shailan-dropdown-menu'); ?> <?php $this->help_link('exclude'); ?> <input class="widefat" id="<?php echo $this->get_field_id('exclude'); ?>" name="<?php echo $this->get_field_name('exclude'); ?>" type="text" value="<?php echo $exclude; ?>" /></label><br />
|
429 |
+
<small>Page IDs, separated by commas.</small></p>
|
430 |
+
|
431 |
+
<p><label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Menu Width:', 'shailan-dropdown-menu'); ?> <?php $this->help_link('widget-width'); ?><input class="widefat" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo $width; ?>" /></label><br />
|
432 |
+
<small>Menu width in pixels (Eg. 200). Leave blank for default.</small></p>
|
433 |
+
|
434 |
+
<p>
|
435 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('home'); ?>" name="<?php echo $this->get_field_name('home'); ?>"<?php checked( $home ); ?> />
|
436 |
+
<label for="<?php echo $this->get_field_id('home'); ?>"><?php _e( 'Add homepage link' , 'shailan-dropdown-menu' ); ?></label><?php $this->help_link('homepage-link'); ?><br />
|
437 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('login'); ?>" name="<?php echo $this->get_field_name('login'); ?>"<?php checked( $login ); ?> />
|
438 |
+
<label for="<?php echo $this->get_field_id('login'); ?>"><?php _e( 'Add login/logout' , 'shailan-dropdown-menu' ); ?></label><?php $this->help_link('login-logout-link'); ?><br />
|
439 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('admin'); ?>" name="<?php echo $this->get_field_name('admin'); ?>"<?php checked( $admin ); ?> />
|
440 |
+
<label for="<?php echo $this->get_field_id('admin'); ?>"><?php _e( 'Add Register/Site Admin' , 'shailan-dropdown-menu' ); ?></label><?php $this->help_link('site-admin-link'); ?><br />
|
441 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('vertical'); ?>" name="<?php echo $this->get_field_name('vertical'); ?>"<?php checked( $vertical ); ?> />
|
442 |
+
<label for="<?php echo $this->get_field_id('vertical'); ?>"><?php _e( 'Vertical menu' , 'shailan-dropdown-menu' ); ?><?php $this->help_link('vertical-menu'); ?></label>
|
443 |
+
</p>
|
444 |
+
|
445 |
+
<p><?php _e('Align:', 'shailan-dropdown-menu'); ?> <?php $this->help_link('alignment'); ?>
|
446 |
+
<label for="left"><input type="radio" id="left" name="<?php echo $this->get_field_name('align'); ?>" value="left" <?php if($align=='left'){ echo 'checked="checked"'; } ?> /><?php _e('Left', 'shailan-dropdown-menu'); ?></label>
|
447 |
+
<label for="center"><input type="radio" id="center" name="<?php echo $this->get_field_name('align'); ?>" value="center" <?php if($align=='center'){ echo 'checked="checked"'; } ?>/> <?php _e('Center', 'shailan-dropdown-menu'); ?></label>
|
448 |
+
<label for="right"><input type="radio" id="right" name="<?php echo $this->get_field_name('align'); ?>" value="right" <?php if($align=='right'){ echo 'checked="checked"'; } ?>/> <?php _e('Right', 'shailan-dropdown-menu'); ?></label>
|
449 |
+
</p>
|
450 |
+
|
451 |
+
<p><?php _e('Current Theme:', 'shailan-dropdown-menu') ?><br />
|
452 |
+
<?php $theme = $this->get_plugin_setting('shailan_dm_active_theme');
|
453 |
+
|
454 |
+
$available_themes = array(
|
455 |
+
'None' => '*none*',
|
456 |
+
'From URL' => '*url*',
|
457 |
+
'Custom CSS' => '*custom*',
|
458 |
+
'Color Scheme' => 'color-scheme',
|
459 |
+
'Web 2.0' => plugins_url('/themes/web20.css', __FILE__),
|
460 |
+
'Simple White' => plugins_url('/themes/simple.css', __FILE__),
|
461 |
+
'Wordpress Default' => plugins_url('/themes/wpdefault.css', __FILE__),
|
462 |
+
'Grayscale' => plugins_url('/themes/grayscale.css', __FILE__),
|
463 |
+
'Aqua' => plugins_url('/themes/aqua.css', __FILE__),
|
464 |
+
'Blue gradient' => plugins_url('/themes/simple-blue.css', __FILE__),
|
465 |
+
'Shiny Black' => plugins_url('/themes/shiny-black.css', __FILE__),
|
466 |
+
'Flickr' => plugins_url('/themes/flickr.com/default.ultimate.css', __FILE__),
|
467 |
+
'Nvidia' => plugins_url('/themes/nvidia.com/default.advanced.css', __FILE__),
|
468 |
+
'Adobe' => plugins_url('/themes/adobe.com/default.advanced.css', __FILE__),
|
469 |
+
'MTV' => plugins_url('/themes/mtv.com/default.ultimate.css', __FILE__),
|
470 |
+
'Hulu' => plugins_url('/themes/hulu/hulu.css', __FILE__),
|
471 |
+
'Rounded Corners' => plugins_url('/themes/rounded-corners.css', __FILE__),
|
472 |
+
'Rounded Corners Light' => plugins_url('/themes/rounded-corners-light.css', __FILE__),
|
473 |
+
'Pills' => plugins_url('/themes/pills.css', __FILE__)
|
474 |
+
);
|
475 |
+
|
476 |
+
$theme_names = array_flip($available_themes);
|
477 |
+
$theme_name = $theme_names[$theme];
|
478 |
+
echo "<strong>" . $theme_name . "</strong>";
|
479 |
+
?>
|
480 |
+
<a href="options-general.php?page=dropdown-menu" target="_blank" style="text-decoration:none;"><?php esc_attr_e('Change theme →', 'shailan-dropdown-menu'); ?></a>
|
481 |
+
</p>
|
482 |
+
|
483 |
+
<br class="clear" />
|
484 |
+
|
485 |
+
<?php
|
486 |
+
}
|
487 |
+
|
488 |
+
/******************************************************************************
|
489 |
+
* HEADER
|
490 |
+
******************************************************************************/
|
491 |
+
function header($instance){
|
492 |
+
|
493 |
+
/*if(!is_admin()){*/
|
494 |
+
|
495 |
+
//$default_headers = array( 'Version' => 'Version' );
|
496 |
+
//$dropdown = get_file_data( __FILE__, $default_headers, 'plugin' );
|
497 |
+
|
498 |
+
$theme = $this->get_plugin_setting('shailan_dm_active_theme');
|
499 |
+
if($theme == '*url*'){ $theme = $this->get_plugin_setting('shailan_dm_theme_url'); }
|
500 |
+
if($theme == ''){ $theme = "web20"; }
|
501 |
+
|
502 |
+
$allow_multiline = (bool) ( 'on' == $this->get_plugin_setting('shailan_dm_allowmultiline') );
|
503 |
+
// Colors
|
504 |
+
$custom_colors = (bool) ( 'on' == $this->get_plugin_setting('shailan_dm_custom_colors') );
|
505 |
+
$shailan_dm_color_menubg = $this->get_plugin_setting('shailan_dm_color_menubg');
|
506 |
+
$shailan_dm_color_lihover = $this->get_plugin_setting('shailan_dm_color_lihover');
|
507 |
+
$shailan_dm_color_link = $this->get_plugin_setting('shailan_dm_color_link');
|
508 |
+
$shailan_dm_color_hoverlink = $this->get_plugin_setting('shailan_dm_color_hoverlink');
|
509 |
+
$is_fx_active = (bool) ( 'on' == $this->get_plugin_setting('shailan_dm_effects') );
|
510 |
+
|
511 |
+
echo "\n\n<!-- Dropdown Menu Widget Styles by shailan (https://metinsaylan.com) v" . VERSION . " on wp" . get_bloginfo( 'version' ) . " -->"; // For debug
|
512 |
+
echo "\n<link rel=\"stylesheet\" href=\"". plugins_url( '/css/shailan-dropdown.min.css' , __FILE__ ) . "\" type=\"text/css\" />";
|
513 |
+
|
514 |
+
if( $theme!='*none*' && $theme != '*custom*' ){
|
515 |
+
if( false === strpos($theme, 'http') ){
|
516 |
+
// Default
|
517 |
+
echo "\n<link rel=\"stylesheet\" href=\"". plugins_url( '/themes/' . $theme . '.css', __FILE__ ) ."\" type=\"text/css\" />";
|
518 |
+
} else {
|
519 |
+
// URL include
|
520 |
+
echo "\n<link rel=\"stylesheet\" href=\"".$theme."\" type=\"text/css\" />";
|
521 |
+
}
|
522 |
+
}
|
523 |
+
|
524 |
+
echo "\n<style type=\"text/css\" media=\"all\">";
|
525 |
+
|
526 |
+
$indent = "\n\t";
|
527 |
+
|
528 |
+
// Font family and font size
|
529 |
+
$font_family = stripslashes( $this->get_plugin_setting('shailan_dm_font') );
|
530 |
+
|
531 |
+
if(!empty($font_family)){ echo $indent. "ul.dropdown li a { font-family:$font_family; } "; }
|
532 |
+
|
533 |
+
$font_size = $this->get_plugin_setting('shailan_dm_fontsize'); //'12px';
|
534 |
+
|
535 |
+
if(!empty($font_size)){ echo $indent. "ul.dropdown li a { font-size:$font_size; }"; }
|
536 |
+
|
537 |
+
if(!$allow_multiline){
|
538 |
+
echo $indent. "ul.dropdown { white-space: nowrap; }";
|
539 |
+
}
|
540 |
+
|
541 |
+
if( $custom_colors ){
|
542 |
+
// Custom color scheme is active
|
543 |
+
|
544 |
+
// Overlay support
|
545 |
+
$overlay = $this->get_plugin_setting('shailan_dm_overlay');
|
546 |
+
echo $indent . "/* Selected overlay: ". $overlay . " */";
|
547 |
+
|
548 |
+
if($overlay!='none' && $theme=='color-scheme' ){
|
549 |
+
$posvert = 0;
|
550 |
+
switch ( $overlay ) {
|
551 |
+
case "glass":
|
552 |
+
$posvert = 0;
|
553 |
+
break;
|
554 |
+
case "flat":
|
555 |
+
$posvert = -100;
|
556 |
+
break;
|
557 |
+
case "shadow":
|
558 |
+
$posvert = -200;
|
559 |
+
break;
|
560 |
+
case "soft":
|
561 |
+
$posvert = -300;
|
562 |
+
break;
|
563 |
+
}
|
564 |
+
|
565 |
+
$apos = $posvert - 2;
|
566 |
+
|
567 |
+
?>
|
568 |
+
|
569 |
+
.shailan-dropdown-menu .dropdown-horizontal-container,
|
570 |
+
ul.dropdown li, ul.dropdown li.hover, ul.dropdown li:hover{ background-position:0px <?php echo $posvert; ?>px; }
|
571 |
+
ul.dropdown li.hover a, ul.dropdown li:hover a{ background-position:0px <?php echo $apos; ?>px; }
|
572 |
+
|
573 |
+
<?php } elseif($overlay == 'none') { ?>
|
574 |
+
/* Clear background images */
|
575 |
+
.shailan-dropdown-menu .dropdown-horizontal-container, ul.dropdown li, ul.dropdown li.hover, ul.dropdown li:hover, ul.dropdown li.hover a, ul.dropdown li:hover a { background-image:none; }
|
576 |
+
<?php } else {/* unidentified overlay ? */} ?>
|
577 |
+
|
578 |
+
.shailan-dropdown-menu .dropdown-horizontal-container, ul.dropdown li{ background-color:<?php echo $shailan_dm_color_menubg; ?>; }
|
579 |
+
ul.dropdown a,
|
580 |
+
ul.dropdown a:link,
|
581 |
+
ul.dropdown a:visited,
|
582 |
+
ul.dropdown li { color: <?php echo $shailan_dm_color_link; ?>; }
|
583 |
+
ul.dropdown a:hover,
|
584 |
+
ul.dropdown li:hover { color: <?php echo $shailan_dm_color_hoverlink; ?>; }
|
585 |
+
ul.dropdown a:active { color: <?php echo $shailan_dm_color_hoverlink; ?>; }
|
586 |
+
|
587 |
+
ul.dropdown li.hover a, ul.dropdown li:hover a{ background-color: <?php echo $shailan_dm_color_lihover; ?>; }
|
588 |
+
ul.dropdown li.hover ul li, ul.dropdown li:hover ul li{ background-color: <?php echo $shailan_dm_color_menubg; ?>;
|
589 |
+
color: <?php echo $shailan_dm_color_link; ?>; }
|
590 |
+
|
591 |
+
ul.dropdown li.hover ul li.hover, ul.dropdown li:hover ul li:hover { background-image: none; }
|
592 |
+
ul.dropdown li.hover a:hover, ul.dropdown li:hover a:hover { background-color: <?php echo $shailan_dm_color_lihover; ?>; }
|
593 |
+
|
594 |
+
ul.dropdown ul{ background-image:none; background-color:<?php echo $shailan_dm_color_menubg; ?>; border:1px solid <?php echo $shailan_dm_color_menubg; ?>; }
|
595 |
+
ul.dropdown-vertical li { border-bottom:1px solid <?php echo $shailan_dm_color_lihover; ?>; }
|
596 |
+
<?php
|
597 |
+
|
598 |
+
} // if($custom_colors)
|
599 |
+
|
600 |
+
// If effects not active, embed CSS display:
|
601 |
+
if(! $is_fx_active){ ?>
|
602 |
+
|
603 |
+
/** Show submenus */
|
604 |
+
ul.dropdown li:hover > ul, ul.dropdown li.hover ul{ display: block; }
|
605 |
+
|
606 |
+
/** Show current submenu */
|
607 |
+
ul.dropdown li.hover ul, ul.dropdown ul li.hover ul, ul.dropdown ul ul li.hover ul, ul.dropdown ul ul ul li.hover ul, ul.dropdown ul ul ul ul li.hover ul , ul.dropdown li:hover ul, ul.dropdown ul li:hover ul, ul.dropdown ul ul li:hover ul, ul.dropdown ul ul ul li:hover ul, ul.dropdown ul ul ul ul li:hover ul { display: block; }
|
608 |
+
|
609 |
+
<?php }
|
610 |
+
|
611 |
+
// Arrow pointers
|
612 |
+
|
613 |
+
if( 'on' == $this->get_plugin_setting('shailan_dm_arrows') ){
|
614 |
+
$clr = $this->get_plugin_setting('shailan_dm_arrow_color');
|
615 |
+
|
616 |
+
?>
|
617 |
+
|
618 |
+
ul.dropdown li.parent>a{
|
619 |
+
padding-right:25px;
|
620 |
+
}
|
621 |
+
ul.dropdown li.parent>a:after{
|
622 |
+
content:""; position:absolute; top: 45%; right:6px;width:0;height:0;
|
623 |
+
border-top:4px solid <?php echo $clr; ?>;border-right:4px solid transparent;border-left:4px solid transparent }
|
624 |
+
ul.dropdown li.parent:hover>a:after{
|
625 |
+
content:"";position:absolute; top: 45%; right:6px; width:0; height:0;
|
626 |
+
border-top:4px solid <?php echo $clr; ?>;border-right:4px solid transparent;border-left:4px solid transparent }
|
627 |
+
ul.dropdown li li.parent>a:after{
|
628 |
+
content:"";position:absolute;top: 40%; right:5px;width:0;height:0;
|
629 |
+
border-left:4px solid <?php echo $clr; ?>;border-top:4px solid transparent;border-bottom:4px solid transparent }
|
630 |
+
ul.dropdown li li.parent:hover>a:after{
|
631 |
+
content:"";position:absolute;top: 40%; right:5px;width:0;height:0;
|
632 |
+
border-left:4px solid <?php echo $clr; ?>;border-top:4px solid transparent;border-bottom:4px solid transparent }
|
633 |
+
|
634 |
+
<?php }
|
635 |
+
|
636 |
+
// Insert Custom CSS last
|
637 |
+
$custom_css = stripslashes( $this->get_plugin_setting('shailan_dm_custom_css') );
|
638 |
+
if(!empty($custom_css)){ echo $custom_css; }
|
639 |
+
echo "\n</style>";
|
640 |
+
echo "\n<!-- /Dropdown Menu Widget Styles -->";
|
641 |
+
echo "\n\n ";
|
642 |
+
|
643 |
+
/*}*/
|
644 |
+
} // -- End Header
|
645 |
+
|
646 |
+
/******************************************************************************
|
647 |
+
* HEADER
|
648 |
+
******************************************************************************/
|
649 |
+
function footer( $instance = null ){
|
650 |
+
$indent = "\n\t";
|
651 |
+
|
652 |
+
$remove_title_attributes = (bool) ( 'on' == $this->get_plugin_setting('shailan_dm_remove_title_attributes') );
|
653 |
+
$remove_top_level_links = (bool) ( 'on' == $this->get_plugin_setting('shailan_dm_remove_top_level_links') );
|
654 |
+
$is_fx_active = (bool) ( 'on' == $this->get_plugin_setting('shailan_dm_effects') );
|
655 |
+
$speed = $this->get_plugin_setting('shailan_dm_effect_speed', '400');
|
656 |
+
$effect = $this->get_plugin_setting('shailan_dm_effect', 'fade');
|
657 |
+
$delay = $this->get_plugin_setting('shailan_dm_effect_delay', '100');
|
658 |
+
|
659 |
+
if( $is_fx_active || $remove_title_attributes || $remove_top_level_links ){
|
660 |
+
|
661 |
+
echo "\n\n<!-- Dropdown Menu Widget Effects by shailan (https://metinsaylan.com) v". VERSION ." on wp".get_bloginfo( 'version' )." -->"; // For debug
|
662 |
+
echo "\n<script type=\"text/javascript\">/* <![CDATA[ */";
|
663 |
+
echo "\njQuery(document).ready(function($) { \n";
|
664 |
+
|
665 |
+
// Remove title attributes from links
|
666 |
+
|
667 |
+
if($remove_title_attributes){
|
668 |
+
?>
|
669 |
+
$('ul.dropdown li a').removeAttr('title');
|
670 |
+
<?php
|
671 |
+
}
|
672 |
+
|
673 |
+
// Remove links from top-level elements
|
674 |
+
|
675 |
+
if($remove_top_level_links){
|
676 |
+
?>
|
677 |
+
$('ul.dropdown>li>ul.children').parent().find('a:first').removeAttr('href');
|
678 |
+
<?php
|
679 |
+
}
|
680 |
+
|
681 |
+
// Dropdown FX
|
682 |
+
|
683 |
+
if( 'fade' == $effect ){
|
684 |
+
?>
|
685 |
+
|
686 |
+
var config = {
|
687 |
+
over : function(){ $(this).find("ul:first").fadeIn('<?php echo $speed; ?>'); },
|
688 |
+
out : function(){ $(this).find("ul:first").fadeOut('<?php echo $speed; ?>'); },
|
689 |
+
timeout : <?php echo $delay; ?>
|
690 |
+
}
|
691 |
+
|
692 |
+
$(".dropdown li").hoverIntent( config );
|
693 |
+
<?php
|
694 |
+
} elseif( 'slide' == $effect ) { ?>
|
695 |
+
|
696 |
+
var config = {
|
697 |
+
over : function(){ $(this).find("ul:first").slideDown('<?php echo $speed; ?>'); },
|
698 |
+
out : function(){ $(this).find("ul:first").slideUp('<?php echo $speed; ?>'); },
|
699 |
+
timeout : <?php echo $delay; ?>
|
700 |
+
}
|
701 |
+
|
702 |
+
$(".dropdown li").hoverIntent( config );
|
703 |
+
<?php
|
704 |
+
} elseif( 'fade2' == $effect ) { ?>
|
705 |
+
|
706 |
+
$(".dropdown li").hoverIntent(
|
707 |
+
function(){ h = $(this).height() + 'px'; $(this).find("ul:first").animate( {opacity:'show', top:h}, '<?php echo $speed; ?>'); },
|
708 |
+
function(){ h = $(this).height() + 5 + 'px'; $(this).find("ul:first").animate( {opacity:'hide', top:h}, '<?php echo $speed; ?>'); }
|
709 |
+
);
|
710 |
+
|
711 |
+
<?php }
|
712 |
+
|
713 |
+
echo "\n});";
|
714 |
+
echo "\n/* ]]> */</script>";
|
715 |
+
echo "\n<!-- /Dropdown Menu Widget Effects -->";
|
716 |
+
echo "\n\n ";
|
717 |
+
|
718 |
+
} // fx active
|
719 |
+
|
720 |
+
}
|
721 |
+
|
722 |
+
function help_link($key, $text = '(?)'){
|
723 |
+
echo '<a href="'.$this->help_url.'#' . $key. '" target="_blank" class="help-link">' . $text . '</a>';
|
724 |
+
}
|
725 |
+
|
726 |
+
}
|
727 |
+
// *** END OF CLASS ***
|
728 |
+
|
729 |
+
function get_dropdown_setting( $key, $default = '' ) {
|
730 |
+
$settings = get_option( 'shailan_dropdown_menu' );
|
731 |
+
$key = 'shailan_dm_' . $key;
|
732 |
+
if( array_key_exists( $key, $settings ) ){
|
733 |
+
return $settings[ $key ];
|
734 |
+
} else {
|
735 |
+
return $default;
|
736 |
+
}
|
737 |
+
|
738 |
+
return FALSE;
|
739 |
+
}
|
740 |
+
|
741 |
+
// Register widget
|
742 |
+
function ddm_register_widget(){
|
743 |
+
register_widget("shailan_DropdownWidget");
|
744 |
+
}
|
745 |
+
add_action( 'widgets_init', 'ddm_register_widget' );
|
746 |
+
|
747 |
+
/* Includes */
|
748 |
+
include('shailan-page-walker.php'); // Load custom page walker
|
749 |
+
include('shailan-category-walker.php'); // Load custom category walker
|
750 |
+
|
751 |
+
/* Custom widget */
|
752 |
+
include('shailan-multi-dropdown.php'); // Load multi-dropdown widget
|
753 |
+
|
754 |
+
// Settings link
|
755 |
+
function shailan_dropdown_add_settings_link($links) {
|
756 |
+
$settings_link = '<a href="options-general.php?page=dropdown-menu">Settings</a>';
|
757 |
+
array_push( $links, $settings_link );
|
758 |
+
return $links;
|
759 |
+
}
|
760 |
+
|
761 |
+
$plugin = plugin_basename(__FILE__);
|
762 |
+
add_filter( "plugin_action_links_$plugin", 'shailan_dropdown_add_settings_link' );
|
763 |
+
|
764 |
+
// Template tag support
|
765 |
+
function shailan_dropdown_menu( $args = array() ){
|
766 |
+
|
767 |
+
$type = get_dropdown_setting( 'type' );
|
768 |
+
$exclude = get_dropdown_setting( 'exclude' );
|
769 |
+
$inline_style = get_dropdown_setting( 'style' );
|
770 |
+
$login = (bool) ( 'on' == get_dropdown_setting( 'login' ) );
|
771 |
+
$admin = (bool) ( 'on' == get_dropdown_setting( 'admin' ) );
|
772 |
+
$vertical = (bool) ( 'on' == get_dropdown_setting( 'vertical' ) );
|
773 |
+
$home = (bool) ( 'on' == get_dropdown_setting( 'home' ) );
|
774 |
+
$align = get_dropdown_setting( 'align' );
|
775 |
+
$width = get_dropdown_setting( 'width' );
|
776 |
+
|
777 |
+
$opts = array(
|
778 |
+
'type' => $type,
|
779 |
+
'exclude' => $exclude,
|
780 |
+
'style' => $inline_style,
|
781 |
+
'login' => $login,
|
782 |
+
'admin' => $admin,
|
783 |
+
'vertical' => $vertical,
|
784 |
+
'home' => $home,
|
785 |
+
'align' => $align,
|
786 |
+
'width' => $width
|
787 |
+
);
|
788 |
+
|
789 |
+
$options = wp_parse_args( $args, $opts );
|
790 |
+
|
791 |
+
if(!empty( $args['menu'] )){ $options['type'] = $args['menu']; }
|
792 |
+
|
793 |
+
the_widget( 'shailan_DropdownWidget', $options );
|
794 |
+
|
795 |
+
}
|
796 |
+
|
797 |
+
/**
|
798 |
+
* Replaces nav menu callback function to use dropdown menu.
|
799 |
+
*
|
800 |
+
* @since 1.9.2
|
801 |
+
*/
|
802 |
+
function shailan_nav_menu_args_filter( $args ){
|
803 |
+
|
804 |
+
$replace_enabled = get_dropdown_setting( 'location_enabled' );
|
805 |
+
|
806 |
+
if( 'on' == $replace_enabled ){
|
807 |
+
$theme_location = get_dropdown_setting( 'location' );
|
808 |
+
|
809 |
+
if( $args['theme_location'] == $theme_location ){
|
810 |
+
$args['fallback_cb'] = 'shailan_dropdown_menu';
|
811 |
+
}
|
812 |
+
}
|
813 |
+
|
814 |
+
return $args;
|
815 |
+
} add_filter('wp_nav_menu_args', 'shailan_nav_menu_args_filter', 90, 1);
|
816 |
+
|
817 |
+
/*
|
818 |
+
function shailan_nav_menu_output_filter( $nav_menu, $args ){
|
819 |
+
return $nav_menu;
|
820 |
+
} add_filter( 'wp_nav_menu', 'shailan_nav_menu_output_filter', 10, 2);
|
821 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stf-page-options.php
CHANGED
@@ -1,186 +1,185 @@
|
|
1 |
-
<div class="wrap stf_options_page">
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
<?php
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
<div class="
|
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 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
<
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
<?php
|
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 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
}
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
</div>
|
177 |
-
</div>
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
<
|
182 |
-
<
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
</div>
|
1 |
+
<div class="wrap stf_options_page">
|
2 |
+
<h2><?php echo esc_html( $title ); ?></h2>
|
3 |
+
|
4 |
+
<!-- Notifications -->
|
5 |
+
<?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) { ?>
|
6 |
+
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
|
7 |
+
<?php } ?>
|
8 |
+
<?php if ( isset($_GET['error']) && isset($errors[$_GET['error']]) ) { ?>
|
9 |
+
<div id="message" class="error fade"><p><?php echo $errors[$_GET['error']]; ?></p></div>
|
10 |
+
<?php } ?>
|
11 |
+
<!-- [End] Notifications -->
|
12 |
+
|
13 |
+
<div id="nav"><?php if(!empty($navigation)){echo $navigation;} ?></div>
|
14 |
+
|
15 |
+
<div class="stf_opts_wrap">
|
16 |
+
<div class="stf_options">
|
17 |
+
|
18 |
+
<div id="demo"><h3>Menu Demo:</h3><?php shailan_dropdown_menu(); ?><br />
|
19 |
+
<em>Please note, demo uses <a href="https://metinsaylan.com/4598/dropdown-menu-widget-template-tag-usage-explained/" target="_blank">php template tag</a>.</em></div>
|
20 |
+
|
21 |
+
<form method="post">
|
22 |
+
<div id="ddmw_options">
|
23 |
+
|
24 |
+
<div class="ddmw_options_container">
|
25 |
+
|
26 |
+
<div id="tabs-footer" class="clearfix">
|
27 |
+
<p class="submit">
|
28 |
+
<?php submit_button( 'Save Changes', 'primary', 'save', false ); ?>
|
29 |
+
<input type="hidden" name="action" value="save" />
|
30 |
+
</p>
|
31 |
+
</form>
|
32 |
+
|
33 |
+
<form method="post">
|
34 |
+
<?php submit_button( 'Reset Options', 'secondary', 'reset', false ); ?>
|
35 |
+
<input type="hidden" name="action" value="reset" />
|
36 |
+
</form>
|
37 |
+
</div>
|
38 |
+
|
39 |
+
<?php foreach ($options as $field) {
|
40 |
+
switch ( $field['type'] ) {
|
41 |
+
|
42 |
+
case 'section': ?>
|
43 |
+
|
44 |
+
<h3 id="<?php echo sanitize_title( $field['name'] ); ?>" class="section-title"><?php echo $field['label']; ?></h3>
|
45 |
+
|
46 |
+
<?php
|
47 |
+
|
48 |
+
case 'open': ?>
|
49 |
+
|
50 |
+
<div class="settings-section">
|
51 |
+
|
52 |
+
<?php break;
|
53 |
+
|
54 |
+
case 'close': ?>
|
55 |
+
|
56 |
+
</div>
|
57 |
+
<div id="tabs-footer" class="clearfix">
|
58 |
+
<p class="submit">
|
59 |
+
<?php submit_button( 'Save Changes', 'primary', 'save', false ); ?>
|
60 |
+
<input type="hidden" name="action" value="save" />
|
61 |
+
</p>
|
62 |
+
</form>
|
63 |
+
|
64 |
+
<form method="post">
|
65 |
+
<?php submit_button( 'Reset Options', 'secondary', 'reset', false ); ?>
|
66 |
+
<input type="hidden" name="action" value="reset" />
|
67 |
+
</form>
|
68 |
+
</div>
|
69 |
+
|
70 |
+
<?php break;
|
71 |
+
|
72 |
+
case 'paragraph': ?>
|
73 |
+
|
74 |
+
<div class="stf_paragraph clearfix">
|
75 |
+
<?php echo $field['desc']; ?>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<?php
|
79 |
+
break;
|
80 |
+
|
81 |
+
case 'text': ?>
|
82 |
+
|
83 |
+
<div class="stf_input stf_text clearfix">
|
84 |
+
<label for="<?php echo $field['id']; ?>"><?php echo $field['name']; ?></label>
|
85 |
+
<input name="<?php echo $field['id']; ?>" id="<?php echo $field['id']; ?>" type="<?php echo $field['type']; ?>" value="<?php if ( isset($current[ $field['id'] ]) && $current[ $field['id'] ] != "") { echo esc_html(stripslashes($current[ $field['id'] ] ) ); } ?>" />
|
86 |
+
<small><?php echo $field['desc']; ?></small>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
<?php
|
90 |
+
break;
|
91 |
+
|
92 |
+
case 'textarea':
|
93 |
+
?>
|
94 |
+
|
95 |
+
<div class="stf_input stf_textarea clearfix">
|
96 |
+
<label for="<?php echo $field['id']; ?>"><?php echo $field['name']; ?></label>
|
97 |
+
<textarea name="<?php echo $field['id']; ?>" type="<?php echo $field['type']; ?>" cols="" rows=""><?php if ( $current[ $field['id'] ] != "") { echo stripslashes($current[ $field['id'] ] ); } else { echo $field['std']; } ?></textarea>
|
98 |
+
<small><?php echo $field['desc']; ?></small>
|
99 |
+
|
100 |
+
</div>
|
101 |
+
|
102 |
+
<?php
|
103 |
+
break;
|
104 |
+
|
105 |
+
case 'htmlarea':
|
106 |
+
?>
|
107 |
+
|
108 |
+
<div class="stf_input stf_textarea clearfix">
|
109 |
+
<label for="<?php echo $field['id']; ?>"><?php echo $field['name']; ?></label>
|
110 |
+
|
111 |
+
<script type="text/javascript">
|
112 |
+
jQuery(document).ready(function($) {
|
113 |
+
$('#<?php echo $field['id']; ?>').wysiwyg();
|
114 |
+
});
|
115 |
+
</script>
|
116 |
+
|
117 |
+
<textarea name="<?php echo $field['id']; ?>" id="<?php echo $field['id']; ?>" type="<?php echo $field['type']; ?>" cols="" rows=""><?php if ( $current[ $field['id'] ] != "") { echo stripslashes($current[ $field['id'] ] ); } else { echo $field['std']; } ?></textarea>
|
118 |
+
<small><?php echo $field['desc']; ?></small>
|
119 |
+
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<?php
|
123 |
+
break;
|
124 |
+
|
125 |
+
case 'select':
|
126 |
+
?>
|
127 |
+
|
128 |
+
<div class="stf_input stf_select clearfix">
|
129 |
+
<label for="<?php echo $field['id']; ?>"><?php echo $field['name']; ?></label>
|
130 |
+
|
131 |
+
<select name="<?php echo $field['id']; ?>" id="<?php echo $field['id']; ?>">
|
132 |
+
<?php foreach ($field['options'] as $key=>$name) { ?>
|
133 |
+
<option <?php if ( isset($current[ $field['id'] ]) && $current[ $field['id'] ] == $key) { echo 'selected="selected"'; } ?> value="<?php echo $key;?>"><?php echo $name; ?></option><?php } ?>
|
134 |
+
</select>
|
135 |
+
|
136 |
+
<small><?php echo $field['desc']; ?></small>
|
137 |
+
</div>
|
138 |
+
<?php
|
139 |
+
break;
|
140 |
+
|
141 |
+
case "checkbox":
|
142 |
+
?>
|
143 |
+
|
144 |
+
<div class="stf_input stf_checkbox clearfix">
|
145 |
+
<label for="<?php echo $field['id']; ?>"><?php echo $field['name']; ?></label>
|
146 |
+
|
147 |
+
<input type="checkbox" name="<?php echo $field['id']; ?>" id="<?php echo $field['id']; ?>" value="on" <?php checked($current[ $field['id'] ], "on") ?> />
|
148 |
+
|
149 |
+
<small><?php echo $field['desc']; ?></small>
|
150 |
+
</div>
|
151 |
+
<?php break;
|
152 |
+
case "section":
|
153 |
+
|
154 |
+
?>
|
155 |
+
|
156 |
+
<div class="stf_section tab_content" id="<?php echo sanitize_title( $field['name'] ); ?>">
|
157 |
+
|
158 |
+
<?php break;
|
159 |
+
|
160 |
+
case "splitter":
|
161 |
+
?>
|
162 |
+
<div class="shailan_dm_input shailan_dm_splitter"></div>
|
163 |
+
<?php break;
|
164 |
+
|
165 |
+
case 'picker':
|
166 |
+
?>
|
167 |
+
<div id="picker"></div>
|
168 |
+
|
169 |
+
<?php break;
|
170 |
+
|
171 |
+
}
|
172 |
+
}
|
173 |
+
?>
|
174 |
+
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
|
179 |
+
<?php if(WP_DEBUG){ ?>
|
180 |
+
<h3>Debug information</h3>
|
181 |
+
<p>You are seeing this because your WP_DEBUG variable is set to true.</p>
|
182 |
+
<pre><?php print_r($current) ?></pre>
|
183 |
+
<?php } ?>
|
184 |
+
|
185 |
+
</div>
|
|