-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathreadme.txt
568 lines (345 loc) · 15 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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
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
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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
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
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
=== Menu Icons by ThemeIsle ===
Contributors: codeinwp, themeisle
Tags: menu, nav-menu, icons, navigation
Requires at least: 4.7
Tested up to: 6.7
Stable tag: trunk
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Spice up your navigation menus with pretty icons, easily.
== Description ==
This plugin gives you the ability to add icons to your menu items, similar to the look of the latest dashboard menu.
https://www.youtube.com/watch?v=YcSotWXIczI
= Usage =
1. After the plugin is activated, go to *Appearance* > *Menus* to edit your menus
1. Enable/Disable icon types in "Menu Icons Settings" meta box
1. Set default settings for current nav menu; these settings will be inherited by the newly added menu items
1. Select icon by clicking on the "Select icon" link
1. Save the menu
= Supported icon types =
- Dashicons (WordPress core icons)
- [Elusive Icons](http://shoestrap.org/downloads/elusive-icons-webfont/) by [Aristeides Stathopoulos](http://shoestrap.org/blog/author/aristath/)
- [Font Awesome](http://fontawesome.io/) by [Dave Gandy](http://twitter.com/davegandy)
- [Foundation Icons](http://zurb.com/playground/foundation-icon-fonts-3/) by [Zurb](http://zurb.com/)
- [Genericons](http://genericons.com/) by [Automattic](http://automattic.com/)
- [Fontello](http://fontello.com/) icon packs
- [TI Icons](http://themeisle.com/free-icons/) icon pack by [ThemeIsle](http://twitter.com/themeisle)
- Image (attachments)
- SVG (attachments)
= Planned supported icon types =
- Image (URL)
= Compatible themes =
Menu icons works with most of the themes out there, especially with popular ones like Twenty Seventeen or [Hestia](https://themeisle.com/themes/hestia/).
Development of this plugin is done on [GitHub](https://github.com/codeinwp/wp-menu-icons). **Pull requests welcome**. Please see [issues reported](https://github.com/codeinwp/wp-menu-icons/issues) there before going to the plugin forum.
== If you like this plugin, then consider checking out our other projects: ==
[CodeinWP Blog](https://www.codeinwp.com/blog/) – Designer's Guide To WordPress
[Revive.Social](https://revive.social) – Social Media Tools
[JustFreeThemes](https://justfreethemes.com) - Free WordPress Themes directory
== Screenshots ==
1. Menu Editor
2. Icon selection
3. Twenty Fourteen with Dashicons
4. Twenty Fourteen with Genericons
5. Twenty Thirteen with Dashicons
6. Twenty Thirteen with Genericons
7. Settings Meta Box (Global)
8. Settings Meta Box (Menu)
== Installation ==
1. Upload `menu-icons` to the `/wp-content/plugins/` directory
1. Activate the plugin through the *Plugins* menu in WordPress
== Frequently Asked Questions ==
= The icons are not showing! =
Make sure that your active theme is using the default walker for displaying the nav menu. If it's using its own custom walker, make sure that the menu item titles are filterable (please consult your theme author about this).
= The icon positions don't look right =
If you're comfortable with editing your theme stylesheet, then you can override the styles from there.
If you have [Jetpack](http://wordpress.org/plugins/jetpack) installed, you can also use its **Custom CSS** module.
Otherwise, I recommend you to use the [Advanced CSS plugin](https://wordpress.org/plugins/advanced-css-editor/).
= Some font icons are not rendering correctly =
This is a bug with the font icon itself. When the font is updated, this plugin will update its font too.
= How do I use css file from CDN? =
You can use the `icon_picker_icon_type_stylesheet_uri` filter, eg:
`
/**
* Load Font Awesome's CSS from CDN
*
* @param string $stylesheet_uri Icon type's stylesheet URI.
* @param string $icon_type_id Icon type's ID.
* @param Icon_Picker_Type_Font $icon_type Icon type's instance.
*
* @return string
*/
function myprefix_font_awesome_css_from_cdn( $stylesheet_uri, $icon_type_id, $icon_type ) {
if ( 'fa' === $icon_type_id ) {
$stylesheet_uri = sprintf(
'https://maxcdn.bootstrapcdn.com/font-awesome/%s/css/font-awesome.min.css',
$icon_type->version
);
}
return $stylesheet_uri;
}
add_filter( 'icon_picker_icon_type_stylesheet_uri', 'myprefix_font_awesome_css_from_cdn', 10, 3 );
`
= Is this plugin extendable? =
**Certainly!** Here's how you can remove an icon type from your plugin/theme:
`
/**
* Remove one or more icon types
*
* Uncomment one or more line to remove icon types
*
* @param array $types Registered icon types.
* @return array
*/
function my_remove_menu_icons_type( $types ) {
// Dashicons
//unset( $types['dashicons'] );
// Elusive
//unset( $types['elusive'] );
// Font Awesome
//unset( $types['fa'] );
// Foundation
//unset( $types['foundation-icons'] );
// Genericons
//unset( $types['genericon'] );
// Image
//unset( $types['image'] );
return $types;
}
add_filter( 'menu_icons_types', 'my_remove_menu_icons_type' );
`
To add a new icon type, take a look at the files inside the `includes/library/icon-picker/includes/types` directory of this plugin.
= I don't want the settings meta box. How do I remove/disable it? =
Add this block of code to your [mu-plugin file](http://codex.wordpress.org/Must_Use_Plugins):
`
add_filter( 'menu_icons_disable_settings', '__return_true' );
`
= How can I change the CSS class for hiding the menu item labels? =
Add this block of code to your [mu-plugin file](http://codex.wordpress.org/Must_Use_Plugins):
`
/**
* Override hidden label class
*
* @param string $class Hidden label class.
* @return string
*/
function my_menu_icons_hidden_label_class( $class ) {
$class = 'hidden';
return $class;
}
add_filter( 'menu_icons_hidden_label_class', 'my_menu_icons_hidden_label_class' );
`
= How can I modify the markup the menu items? =
Add this block of code to your [mu-plugin file](http://codex.wordpress.org/Must_Use_Plugins):
`
/**
* Override menu item markup
*
* @param string $markup Menu item title markup.
* @param integer $id Menu item ID.
* @param array $meta Menu item meta values.
* @param string $title Menu item title.
*
* @return string
*/
function my_menu_icons_override_markup( $markup, $id, $meta, $title ) {
// Do your thing.
return $markup;
}
add_filter( 'menu_icons_item_title', 'my_menu_icons_override_markup', 10, 4 );
`
= Can you please add X icon font? =
Let me know via [GitHub issues](https://github.com/codeinw/wp-menu-icons/issues) and I'll see what I can do.
= How do I disable menu icons for a certain menu? =
Add this block of code to your [mu-plugin file](http://codex.wordpress.org/Must_Use_Plugins):
`
/**
* Disable menu icons for a menu
*
* @param array $menu_settings Menu Settings.
* @param int $menu_id Menu ID.
*
* @return array
*/
function my_menu_icons_menu_settings( $menu_settings, $menu_id ) {
if ( 13 === $menu_id ) {
$menu_settings['disabled'] = true;
}
return $menu_settings;
}
add_filter( 'menu_icons_menu_settings', 'my_menu_icons_menu_settings', 10, 2 );
`
= How do I add an icon pack from Fontello? =
1. Create a new directory called `fontpacks` in `wp-content`.
1. Grab the zip of the pack, extract, and upload it to the newly created directory.
1. Enable the icon type from the Settings meta box.
= I can't select a custom image size from the *Image Size* dropdown =
Read [this blog post](http://kucrut.org/add-custom-image-sizes-right-way/).
== Changelog ==
##### [Version 0.13.16](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.15...v0.13.16) (2024-11-07)
- Updated dependencies
##### [Version 0.13.15](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.14...v0.13.15) (2024-07-10)
- Removed recommendations of unsupported plugins
- Fixed conditions for theme recommendation
##### [Version 0.13.14](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.13...v0.13.14) (2024-05-14)
- Enhanced security
##### [Version 0.13.13](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.12...v0.13.13) (2024-04-18)
### Improvements
- **Updated internal dependencies:** Enhanced performance and security.
##### [Version 0.13.12](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.11...v0.13.12) (2024-04-01)
### Improvements
- **Updated internal dependencies**
##### [Version 0.13.11](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.10...v0.13.11) (2024-03-29)
### Fixes
- Updated internal dependencies
- Enhanced security
##### [Version 0.13.10](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.9...v0.13.10) (2024-03-26)
### Improvements
- Updated internal dependencies
- Improved readme to link to the public source files
- Filter promotions
##### [Version 0.13.9](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.8...v0.13.9) (2024-02-23)
### Fixes
- Updated dependencies
- Harden security
##### [Version 0.13.8](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.7...v0.13.8) (2023-12-19)
- SDK Updates
- Fixed global hide label issue
##### [Version 0.13.7](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.6...v0.13.7) (2023-08-17)
- Updated dependencies
- Fixed broken button layout issues in other languages
##### [Version 0.13.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.5...v0.13.6) (2023-07-07)
- Updated composer dependencies to address warning in the widgets section
##### [Version 0.13.5](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.4...v0.13.5) (2023-03-30)
- Updated Dependencies and WordPress core tested up to version 6.2
##### [Version 0.13.4](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.3...v0.13.4) (2023-03-01)
Update dependencies
##### [Version 0.13.3](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.2...v0.13.3) (2023-02-25)
- Fix img width/height value, props @Htbaa
- Update dependencies
##### [Version 0.13.2](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.1...v0.13.2) (2022-11-24)
* Fix - update dependencies
##### [Version 0.13.1](https://github.com/codeinwp/wp-menu-icons/compare/v0.13.0...v0.13.1) (2022-11-04)
Tested with the WordPress 6.1 version
#### [Version 0.13.0](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.12...v0.13.0) (2022-08-23)
* Fix Neve upsells showing up inconsistently on edge cases
* Fix inconsistency with Font Awesome 5 and adds compatibility with 6th version
* Fix compatibility with JupiterX
* Update dependencies
##### [Version 0.12.12](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.11...v0.12.12) (2022-05-27)
- Fix the style handler conflict issue which breaks the arrow icon of the submenus on some themes
- Fix dismiss dashboard notice issue on some edge cases
- Fix compatibility with the Max Mega Menu plugin
##### [Version 0.12.11](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.10...v0.12.11) (2022-03-16)
Add font awesome 5 support
Enhance compatibility with Otter/Neve
##### [Version 0.12.10](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.9...v0.12.10) (2022-02-07)
- [Fix] Add support for alt attribute for SVG icons
- Tested up with WordPress 5.9
##### [Version 0.12.9](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.8...v0.12.9) (2021-08-04)
* Tested compatibility with WordPress 5.8
##### [Version 0.12.8](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.7...v0.12.8) (2021-05-12)
* Fix issue when the image is not accessible to fetch the width/height metadata.
##### [Version 0.12.7](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.6...v0.12.7) (2021-05-07)
Fix PHP fatal error when uploading SVG with the image uploader
##### [Version 0.12.6](https://github.com/codeinwp/wp-menu-icons/compare/v0.12.5...v0.12.6) (2021-05-05)
* Adds explicit width/height to icons to prevent layout shifts issues
= 0.12.4 - 2020-07-13 =
* Fix Font Awesome not loading
= 0.12.3 - 2020-07-13 =
* Fixed Menu Icons in Block Editor not working
* Fixed CWP links.
= 0.12.2 - 2019-11-15 =
= 0.12.1 - 2019-11-15 =
* Improve legacy compatibility
= 0.12.0 - 2019-11-15 =
* Fix issues with WordPress 5.3.
= 0.11.5 - 2019-05-23 =
* Sync composer dependencies with the latest version
= 0.11.4 - 2018-12-10 =
* fix issue with composer libraries.
= 0.11.3 - 2018-12-10 =
* Tested with WP 5.0
= 0.11.2 - 2018-03-05 =
* Improve popup sidebar layout.
= 0.11.1 - 2018-02-24 =
* Add recommendation boxes in the menu icon popup.
= 0.11.0 - 2018-01-05 =
* Change ownership to ThemeIsle.
* Improves compatibility with various ThemeIsle products.
= 0.10.2 =
* Compatibility with WordPress 4.7.0, props [Aaron K](https://github.com/aaronkirkham).
= 0.10.1 =
* Support RTL, props [ybspost](https://wordpress.org/support/profile/ybspost).
= 0.10.0 =
* Icon Picker 0.4.0
* Font Awesome 4.6.1
* Introduce `icon_picker_icon_type_stylesheet_uri` filter hook.
* Add `aria-hidden="true"` attribute to icon element
= 0.9.3 =
* Fix CSS conflicts
= 0.9.2 =
* Update Icon Picker to [0.1.1](https://github.com/kucrut/wp-icon-picker/releases/tag/v0.1.1).
= 0.9.1 =
* Fix support for Composer.
= 0.9.0 =
* Performance optimization.
* Modularisation. Developers: Take a look at the [Icon Picker](https://github.com/kucrut/wp-icon-picker) library.
* Bug fixes.
* Removed `menu_icons_{type_id}_props` filter.
= 0.8.1 =
* Fix disappearing icons from front-end when not logged-in, props [jj9617](http://profiles.wordpress.org/jj9617/)
= 0.8.0 =
* Update Dashicons
* Update Genericons to 3.4
* Update Font Awesome to 4.4.0
* Allow the plugin to be disabled for a certain menu
* Add new icon type: SVG, props [Ethan Clevenger](https://github.com/ethanclevenger91)
* Add new filter: `menu_icons_hidden_label_class`
* Add new filter: `menu_icons_item_title`
= 0.7.0 =
* Update Dashicons
* Fix annoying browser popup when navigating away from Nav Menus screen
* Work-around settings update with ajax
= 0.6.0 =
* Update Genericons to [3.2](http://genericons.com/2014/10/03/3-2/)
* Update Font Awesome to [4.2.0](http://fontawesome.io/whats-new/)
= 0.5.1 =
* Update Menu Item Custom Fields to play nice with other plugins.
* Add missing Foundation Icons stylesheet, props [John](http://wordpress.org/support/profile/dsl225)
* JS & CSS fixes
= 0.5.0 =
* New Icon type: Foundation Icons
* Add new Dashicons icons
* Various fixes & enhancements
= 0.4.0 =
* Fontello icon packs support
* New icon type: Image (attachments)
= 0.3.2 =
* Add missing minified CSS for Elusive font icon, props [zazou83](http://profiles.wordpress.org/zazou83)
= 0.3.1 =
* Fix fatal error on outdated PHP versions, props [dellos](http://profiles.wordpress.org/dellos)
= 0.3.0 =
* Add Settings meta box on Menu screen
* New feature: Settings inheritance (nav menu > menu items)
* New feature: Hide menu item labels
* New Icon type: Elusive Icons
* Update Font Awesome to 4.1.0
= 0.2.3 =
* Add new group for Dashicons: Media
= 0.2.1 =
* Fix icon selector compatibility with WP 3.9
= 0.2.0 =
* Media frame for icon selection
* New font icon: Font Awesome
= 0.1.5 =
* Invisible, but important fixes and improvements
= 0.1.4 =
* Fix menu saving
= 0.1.3 =
* Provide icon selection fields on newly added menu items
= 0.1.2 =
* Improve extra stylesheet
= 0.1.1 =
* Improve icon selection UX
= 0.1.0 =
* Initial public release