privacy
5 years ago
promo
6 years ago
yit-ajax.php
7 years ago
yit-assets.php
5 years ago
yit-cpt-unlimited.php
6 years ago
yit-debug.php
7 years ago
yit-icons.php
7 years ago
yit-metabox.php
6 years ago
yit-plugin-common.php
8 years ago
yit-plugin-gradients.php
6 years ago
yit-plugin-licence.php
5 years ago
yit-plugin-panel-wc.php
5 years ago
yit-plugin-panel.php
5 years ago
yit-plugin-subpanel.php
6 years ago
yit-pointers.php
6 years ago
yit-theme-licence.php
6 years ago
yit-upgrade.php
6 years ago
yit-video.php
7 years ago
yith-dashboard.php
7 years ago
yith-gutenberg.php
7 years ago
yith-system-status.php
5 years ago
yit-icons.php
1145 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This file belongs to the YIT Framework. |
| 4 | * |
| 5 | * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0) |
| 6 | * that is bundled with this package in the file LICENSE.txt. |
| 7 | * It is also available through the world-wide-web at this URL: |
| 8 | * http://www.gnu.org/licenses/gpl-3.0.txt |
| 9 | */ |
| 10 | |
| 11 | |
| 12 | if ( !defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } // Exit if accessed directly |
| 15 | |
| 16 | if ( !class_exists( 'YIT_Icons' ) ) { |
| 17 | /** |
| 18 | * YIT Icons |
| 19 | * |
| 20 | * Class to manage icons |
| 21 | * |
| 22 | * @class YIT_Icons |
| 23 | * @package YITH |
| 24 | * @since 1.0.0 |
| 25 | * @author Leanza Francesco <leanzafrancesco@gmail.com> |
| 26 | * |
| 27 | */ |
| 28 | class YIT_Icons { |
| 29 | |
| 30 | /** |
| 31 | * Single instance of the class |
| 32 | * |
| 33 | * @var YIT_Icons |
| 34 | */ |
| 35 | private static $_instance; |
| 36 | |
| 37 | /** |
| 38 | * @var array |
| 39 | */ |
| 40 | private $_data |
| 41 | = array( |
| 42 | 'font_awesome_version' => '4.6.3', |
| 43 | 'icons' => array( |
| 44 | 'FontAwesome' => array( |
| 45 | '\f000' => 'glass', |
| 46 | '\f001' => 'music', |
| 47 | '\f002' => 'search', |
| 48 | '\f003' => 'envelope-o', |
| 49 | '\f004' => 'heart', |
| 50 | '\f005' => 'star', |
| 51 | '\f006' => 'star-o', |
| 52 | '\f007' => 'user', |
| 53 | '\f008' => 'film', |
| 54 | '\f009' => 'th-large', |
| 55 | '\f00a' => 'th', |
| 56 | '\f00b' => 'th-list', |
| 57 | '\f00c' => 'check', |
| 58 | '\f00d' => 'times', |
| 59 | '\f00e' => 'search-plus', |
| 60 | '\f010' => 'search-minus', |
| 61 | '\f011' => 'power-off', |
| 62 | '\f012' => 'signal', |
| 63 | '\f013' => 'cog', |
| 64 | '\f014' => 'trash-o', |
| 65 | '\f015' => 'home', |
| 66 | '\f016' => 'file-o', |
| 67 | '\f017' => 'clock-o', |
| 68 | '\f018' => 'road', |
| 69 | '\f019' => 'download', |
| 70 | '\f01a' => 'arrow-circle-o-down', |
| 71 | '\f01b' => 'arrow-circle-o-up', |
| 72 | '\f01c' => 'inbox', |
| 73 | '\f01d' => 'play-circle-o', |
| 74 | '\f01e' => 'repeat', |
| 75 | '\f021' => 'refresh', |
| 76 | '\f022' => 'list-alt', |
| 77 | '\f023' => 'lock', |
| 78 | '\f024' => 'flag', |
| 79 | '\f025' => 'headphones', |
| 80 | '\f026' => 'volume-off', |
| 81 | '\f027' => 'volume-down', |
| 82 | '\f028' => 'volume-up', |
| 83 | '\f029' => 'qrcode', |
| 84 | '\f02a' => 'barcode', |
| 85 | '\f02b' => 'tag', |
| 86 | '\f02c' => 'tags', |
| 87 | '\f02d' => 'book', |
| 88 | '\f02e' => 'bookmark', |
| 89 | '\f02f' => 'print', |
| 90 | '\f030' => 'camera', |
| 91 | '\f031' => 'font', |
| 92 | '\f032' => 'bold', |
| 93 | '\f033' => 'italic', |
| 94 | '\f034' => 'text-height', |
| 95 | '\f035' => 'text-width', |
| 96 | '\f036' => 'align-left', |
| 97 | '\f037' => 'align-center', |
| 98 | '\f038' => 'align-right', |
| 99 | '\f039' => 'align-justify', |
| 100 | '\f03a' => 'list', |
| 101 | '\f03b' => 'outdent', |
| 102 | '\f03c' => 'indent', |
| 103 | '\f03d' => 'video-camera', |
| 104 | '\f03e' => 'picture-o', |
| 105 | '\f040' => 'pencil', |
| 106 | '\f041' => 'map-marker', |
| 107 | '\f042' => 'adjust', |
| 108 | '\f043' => 'tint', |
| 109 | '\f044' => 'pencil-square-o', |
| 110 | '\f045' => 'share-square-o', |
| 111 | '\f046' => 'check-square-o', |
| 112 | '\f047' => 'arrows', |
| 113 | '\f048' => 'step-backward', |
| 114 | '\f049' => 'fast-backward', |
| 115 | '\f04a' => 'backward', |
| 116 | '\f04b' => 'play', |
| 117 | '\f04c' => 'pause', |
| 118 | '\f04d' => 'stop', |
| 119 | '\f04e' => 'forward', |
| 120 | '\f050' => 'fast-forward', |
| 121 | '\f051' => 'step-forward', |
| 122 | '\f052' => 'eject', |
| 123 | '\f053' => 'chevron-left', |
| 124 | '\f054' => 'chevron-right', |
| 125 | '\f055' => 'plus-circle', |
| 126 | '\f056' => 'minus-circle', |
| 127 | '\f057' => 'times-circle', |
| 128 | '\f058' => 'check-circle', |
| 129 | '\f059' => 'question-circle', |
| 130 | '\f05a' => 'info-circle', |
| 131 | '\f05b' => 'crosshairs', |
| 132 | '\f05c' => 'times-circle-o', |
| 133 | '\f05d' => 'check-circle-o', |
| 134 | '\f05e' => 'ban', |
| 135 | '\f060' => 'arrow-left', |
| 136 | '\f061' => 'arrow-right', |
| 137 | '\f062' => 'arrow-up', |
| 138 | '\f063' => 'arrow-down', |
| 139 | '\f064' => 'share', |
| 140 | '\f065' => 'expand', |
| 141 | '\f066' => 'compress', |
| 142 | '\f067' => 'plus', |
| 143 | '\f068' => 'minus', |
| 144 | '\f069' => 'asterisk', |
| 145 | '\f06a' => 'exclamation-circle', |
| 146 | '\f06b' => 'gift', |
| 147 | '\f06c' => 'leaf', |
| 148 | '\f06d' => 'fire', |
| 149 | '\f06e' => 'eye', |
| 150 | '\f070' => 'eye-slash', |
| 151 | '\f071' => 'exclamation-triangle', |
| 152 | '\f072' => 'plane', |
| 153 | '\f073' => 'calendar', |
| 154 | '\f074' => 'random', |
| 155 | '\f075' => 'comment', |
| 156 | '\f076' => 'magnet', |
| 157 | '\f077' => 'chevron-up', |
| 158 | '\f078' => 'chevron-down', |
| 159 | '\f079' => 'retweet', |
| 160 | '\f07a' => 'shopping-cart', |
| 161 | '\f07b' => 'folder', |
| 162 | '\f07c' => 'folder-open', |
| 163 | '\f07d' => 'arrows-v', |
| 164 | '\f07e' => 'arrows-h', |
| 165 | '\f080' => 'bar-chart', |
| 166 | '\f081' => 'twitter-square', |
| 167 | '\f082' => 'facebook-square', |
| 168 | '\f083' => 'camera-retro', |
| 169 | '\f084' => 'key', |
| 170 | '\f085' => 'cogs', |
| 171 | '\f086' => 'comments', |
| 172 | '\f087' => 'thumbs-o-up', |
| 173 | '\f088' => 'thumbs-o-down', |
| 174 | '\f089' => 'star-half', |
| 175 | '\f08a' => 'heart-o', |
| 176 | '\f08b' => 'sign-out', |
| 177 | '\f08c' => 'linkedin-square', |
| 178 | '\f08d' => 'thumb-tack', |
| 179 | '\f08e' => 'external-link', |
| 180 | '\f090' => 'sign-in', |
| 181 | '\f091' => 'trophy', |
| 182 | '\f092' => 'github-square', |
| 183 | '\f093' => 'upload', |
| 184 | '\f094' => 'lemon-o', |
| 185 | '\f095' => 'phone', |
| 186 | '\f096' => 'square-o', |
| 187 | '\f097' => 'bookmark-o', |
| 188 | '\f098' => 'phone-square', |
| 189 | '\f099' => 'twitter', |
| 190 | '\f09a' => 'facebook', |
| 191 | '\f09b' => 'github', |
| 192 | '\f09c' => 'unlock', |
| 193 | '\f09d' => 'credit-card', |
| 194 | '\f09e' => 'rss', |
| 195 | '\f0a0' => 'hdd-o', |
| 196 | '\f0a1' => 'bullhorn', |
| 197 | '\f0a2' => 'bell-o', |
| 198 | '\f0a3' => 'certificate', |
| 199 | '\f0a4' => 'hand-o-right', |
| 200 | '\f0a5' => 'hand-o-left', |
| 201 | '\f0a6' => 'hand-o-up', |
| 202 | '\f0a7' => 'hand-o-down', |
| 203 | '\f0a8' => 'arrow-circle-left', |
| 204 | '\f0a9' => 'arrow-circle-right', |
| 205 | '\f0aa' => 'arrow-circle-up', |
| 206 | '\f0ab' => 'arrow-circle-down', |
| 207 | '\f0ac' => 'globe', |
| 208 | '\f0ad' => 'wrench', |
| 209 | '\f0ae' => 'tasks', |
| 210 | '\f0b0' => 'filter', |
| 211 | '\f0b1' => 'briefcase', |
| 212 | '\f0b2' => 'arrows-alt', |
| 213 | '\f0c0' => 'users', |
| 214 | '\f0c1' => 'link', |
| 215 | '\f0c2' => 'cloud', |
| 216 | '\f0c3' => 'flask', |
| 217 | '\f0c4' => 'scissors', |
| 218 | '\f0c5' => 'files-o', |
| 219 | '\f0c6' => 'paperclip', |
| 220 | '\f0c7' => 'floppy-o', |
| 221 | '\f0c8' => 'square', |
| 222 | '\f0c9' => 'bars', |
| 223 | '\f0ca' => 'list-ul', |
| 224 | '\f0cb' => 'list-ol', |
| 225 | '\f0cc' => 'strikethrough', |
| 226 | '\f0cd' => 'underline', |
| 227 | '\f0ce' => 'table', |
| 228 | '\f0d0' => 'magic', |
| 229 | '\f0d1' => 'truck', |
| 230 | '\f0d2' => 'pinterest', |
| 231 | '\f0d3' => 'pinterest-square', |
| 232 | '\f0d4' => 'google-plus-square', |
| 233 | '\f0d5' => 'google-plus', |
| 234 | '\f0d6' => 'money', |
| 235 | '\f0d7' => 'caret-down', |
| 236 | '\f0d8' => 'caret-up', |
| 237 | '\f0d9' => 'caret-left', |
| 238 | '\f0da' => 'caret-right', |
| 239 | '\f0db' => 'columns', |
| 240 | '\f0dc' => 'sort', |
| 241 | '\f0dd' => 'sort-desc', |
| 242 | '\f0de' => 'sort-asc', |
| 243 | '\f0e0' => 'envelope', |
| 244 | '\f0e1' => 'linkedin', |
| 245 | '\f0e2' => 'undo', |
| 246 | '\f0e3' => 'gavel', |
| 247 | '\f0e4' => 'tachometer', |
| 248 | '\f0e5' => 'comment-o', |
| 249 | '\f0e6' => 'comments-o', |
| 250 | '\f0e7' => 'bolt', |
| 251 | '\f0e8' => 'sitemap', |
| 252 | '\f0e9' => 'umbrella', |
| 253 | '\f0ea' => 'clipboard', |
| 254 | '\f0eb' => 'lightbulb-o', |
| 255 | '\f0ec' => 'exchange', |
| 256 | '\f0ed' => 'cloud-download', |
| 257 | '\f0ee' => 'cloud-upload', |
| 258 | '\f0f0' => 'user-md', |
| 259 | '\f0f1' => 'stethoscope', |
| 260 | '\f0f2' => 'suitcase', |
| 261 | '\f0f3' => 'bell', |
| 262 | '\f0f4' => 'coffee', |
| 263 | '\f0f5' => 'cutlery', |
| 264 | '\f0f6' => 'file-text-o', |
| 265 | '\f0f7' => 'building-o', |
| 266 | '\f0f8' => 'hospital-o', |
| 267 | '\f0f9' => 'ambulance', |
| 268 | '\f0fa' => 'medkit', |
| 269 | '\f0fb' => 'fighter-jet', |
| 270 | '\f0fc' => 'beer', |
| 271 | '\f0fd' => 'h-square', |
| 272 | '\f0fe' => 'plus-square', |
| 273 | '\f100' => 'angle-double-left', |
| 274 | '\f101' => 'angle-double-right', |
| 275 | '\f102' => 'angle-double-up', |
| 276 | '\f103' => 'angle-double-down', |
| 277 | '\f104' => 'angle-left', |
| 278 | '\f105' => 'angle-right', |
| 279 | '\f106' => 'angle-up', |
| 280 | '\f107' => 'angle-down', |
| 281 | '\f108' => 'desktop', |
| 282 | '\f109' => 'laptop', |
| 283 | '\f10a' => 'tablet', |
| 284 | '\f10b' => 'mobile', |
| 285 | '\f10c' => 'circle-o', |
| 286 | '\f10d' => 'quote-left', |
| 287 | '\f10e' => 'quote-right', |
| 288 | '\f110' => 'spinner', |
| 289 | '\f111' => 'circle', |
| 290 | '\f112' => 'reply', |
| 291 | '\f113' => 'github-alt', |
| 292 | '\f114' => 'folder-o', |
| 293 | '\f115' => 'folder-open-o', |
| 294 | '\f118' => 'smile-o', |
| 295 | '\f119' => 'frown-o', |
| 296 | '\f11a' => 'meh-o', |
| 297 | '\f11b' => 'gamepad', |
| 298 | '\f11c' => 'keyboard-o', |
| 299 | '\f11d' => 'flag-o', |
| 300 | '\f11e' => 'flag-checkered', |
| 301 | '\f120' => 'terminal', |
| 302 | '\f121' => 'code', |
| 303 | '\f122' => 'reply-all', |
| 304 | '\f123' => 'star-half-o', |
| 305 | '\f124' => 'location-arrow', |
| 306 | '\f125' => 'crop', |
| 307 | '\f126' => 'code-fork', |
| 308 | '\f127' => 'chain-broken', |
| 309 | '\f128' => 'question', |
| 310 | '\f129' => 'info', |
| 311 | '\f12a' => 'exclamation', |
| 312 | '\f12b' => 'superscript', |
| 313 | '\f12c' => 'subscript', |
| 314 | '\f12d' => 'eraser', |
| 315 | '\f12e' => 'puzzle-piece', |
| 316 | '\f130' => 'microphone', |
| 317 | '\f131' => 'microphone-slash', |
| 318 | '\f132' => 'shield', |
| 319 | '\f133' => 'calendar-o', |
| 320 | '\f134' => 'fire-extinguisher', |
| 321 | '\f135' => 'rocket', |
| 322 | '\f136' => 'maxcdn', |
| 323 | '\f137' => 'chevron-circle-left', |
| 324 | '\f138' => 'chevron-circle-right', |
| 325 | '\f139' => 'chevron-circle-up', |
| 326 | '\f13a' => 'chevron-circle-down', |
| 327 | '\f13b' => 'html5', |
| 328 | '\f13c' => 'css3', |
| 329 | '\f13d' => 'anchor', |
| 330 | '\f13e' => 'unlock-alt', |
| 331 | '\f140' => 'bullseye', |
| 332 | '\f141' => 'ellipsis-h', |
| 333 | '\f142' => 'ellipsis-v', |
| 334 | '\f143' => 'rss-square', |
| 335 | '\f144' => 'play-circle', |
| 336 | '\f145' => 'ticket', |
| 337 | '\f146' => 'minus-square', |
| 338 | '\f147' => 'minus-square-o', |
| 339 | '\f148' => 'level-up', |
| 340 | '\f149' => 'level-down', |
| 341 | '\f14a' => 'check-square', |
| 342 | '\f14b' => 'pencil-square', |
| 343 | '\f14c' => 'external-link-square', |
| 344 | '\f14d' => 'share-square', |
| 345 | '\f14e' => 'compass', |
| 346 | '\f150' => 'caret-square-o-down', |
| 347 | '\f151' => 'caret-square-o-up', |
| 348 | '\f152' => 'caret-square-o-right', |
| 349 | '\f153' => 'eur', |
| 350 | '\f154' => 'gbp', |
| 351 | '\f155' => 'usd', |
| 352 | '\f156' => 'inr', |
| 353 | '\f157' => 'jpy', |
| 354 | '\f158' => 'rub', |
| 355 | '\f159' => 'krw', |
| 356 | '\f15a' => 'btc', |
| 357 | '\f15b' => 'file', |
| 358 | '\f15c' => 'file-text', |
| 359 | '\f15d' => 'sort-alpha-asc', |
| 360 | '\f15e' => 'sort-alpha-desc', |
| 361 | '\f160' => 'sort-amount-asc', |
| 362 | '\f161' => 'sort-amount-desc', |
| 363 | '\f162' => 'sort-numeric-asc', |
| 364 | '\f163' => 'sort-numeric-desc', |
| 365 | '\f164' => 'thumbs-up', |
| 366 | '\f165' => 'thumbs-down', |
| 367 | '\f166' => 'youtube-square', |
| 368 | '\f167' => 'youtube', |
| 369 | '\f168' => 'xing', |
| 370 | '\f169' => 'xing-square', |
| 371 | '\f16a' => 'youtube-play', |
| 372 | '\f16b' => 'dropbox', |
| 373 | '\f16c' => 'stack-overflow', |
| 374 | '\f16d' => 'instagram', |
| 375 | '\f16e' => 'flickr', |
| 376 | '\f170' => 'adn', |
| 377 | '\f171' => 'bitbucket', |
| 378 | '\f172' => 'bitbucket-square', |
| 379 | '\f173' => 'tumblr', |
| 380 | '\f174' => 'tumblr-square', |
| 381 | '\f175' => 'long-arrow-down', |
| 382 | '\f176' => 'long-arrow-up', |
| 383 | '\f177' => 'long-arrow-left', |
| 384 | '\f178' => 'long-arrow-right', |
| 385 | '\f179' => 'apple', |
| 386 | '\f17a' => 'windows', |
| 387 | '\f17b' => 'android', |
| 388 | '\f17c' => 'linux', |
| 389 | '\f17d' => 'dribbble', |
| 390 | '\f17e' => 'skype', |
| 391 | '\f180' => 'foursquare', |
| 392 | '\f181' => 'trello', |
| 393 | '\f182' => 'female', |
| 394 | '\f183' => 'male', |
| 395 | '\f184' => 'gratipay', |
| 396 | '\f185' => 'sun-o', |
| 397 | '\f186' => 'moon-o', |
| 398 | '\f187' => 'archive', |
| 399 | '\f188' => 'bug', |
| 400 | '\f189' => 'vk', |
| 401 | '\f18a' => 'weibo', |
| 402 | '\f18b' => 'renren', |
| 403 | '\f18c' => 'pagelines', |
| 404 | '\f18d' => 'stack-exchange', |
| 405 | '\f18e' => 'arrow-circle-o-right', |
| 406 | '\f190' => 'arrow-circle-o-left', |
| 407 | '\f191' => 'caret-square-o-left', |
| 408 | '\f192' => 'dot-circle-o', |
| 409 | '\f193' => 'wheelchair', |
| 410 | '\f194' => 'vimeo-square', |
| 411 | '\f195' => 'try', |
| 412 | '\f196' => 'plus-square-o', |
| 413 | '\f197' => 'space-shuttle', |
| 414 | '\f198' => 'slack', |
| 415 | '\f199' => 'envelope-square', |
| 416 | '\f19a' => 'wordpress', |
| 417 | '\f19b' => 'openid', |
| 418 | '\f19c' => 'university', |
| 419 | '\f19d' => 'graduation-cap', |
| 420 | '\f19e' => 'yahoo', |
| 421 | '\f1a0' => 'google', |
| 422 | '\f1a1' => 'reddit', |
| 423 | '\f1a2' => 'reddit-square', |
| 424 | '\f1a3' => 'stumbleupon-circle', |
| 425 | '\f1a4' => 'stumbleupon', |
| 426 | '\f1a5' => 'delicious', |
| 427 | '\f1a6' => 'digg', |
| 428 | '\f1a7' => 'pied-piper-pp', |
| 429 | '\f1a8' => 'pied-piper-alt', |
| 430 | '\f1a9' => 'drupal', |
| 431 | '\f1aa' => 'joomla', |
| 432 | '\f1ab' => 'language', |
| 433 | '\f1ac' => 'fax', |
| 434 | '\f1ad' => 'building', |
| 435 | '\f1ae' => 'child', |
| 436 | '\f1b0' => 'paw', |
| 437 | '\f1b1' => 'spoon', |
| 438 | '\f1b2' => 'cube', |
| 439 | '\f1b3' => 'cubes', |
| 440 | '\f1b4' => 'behance', |
| 441 | '\f1b5' => 'behance-square', |
| 442 | '\f1b6' => 'steam', |
| 443 | '\f1b7' => 'steam-square', |
| 444 | '\f1b8' => 'recycle', |
| 445 | '\f1b9' => 'car', |
| 446 | '\f1ba' => 'taxi', |
| 447 | '\f1bb' => 'tree', |
| 448 | '\f1bc' => 'spotify', |
| 449 | '\f1bd' => 'deviantart', |
| 450 | '\f1be' => 'soundcloud', |
| 451 | '\f1c0' => 'database', |
| 452 | '\f1c1' => 'file-pdf-o', |
| 453 | '\f1c2' => 'file-word-o', |
| 454 | '\f1c3' => 'file-excel-o', |
| 455 | '\f1c4' => 'file-powerpoint-o', |
| 456 | '\f1c5' => 'file-image-o', |
| 457 | '\f1c6' => 'file-archive-o', |
| 458 | '\f1c7' => 'file-audio-o', |
| 459 | '\f1c8' => 'file-video-o', |
| 460 | '\f1c9' => 'file-code-o', |
| 461 | '\f1ca' => 'vine', |
| 462 | '\f1cb' => 'codepen', |
| 463 | '\f1cc' => 'jsfiddle', |
| 464 | '\f1cd' => 'life-ring', |
| 465 | '\f1ce' => 'circle-o-notch', |
| 466 | '\f1d0' => 'rebel', |
| 467 | '\f1d1' => 'empire', |
| 468 | '\f1d2' => 'git-square', |
| 469 | '\f1d3' => 'git', |
| 470 | '\f1d4' => 'hacker-news', |
| 471 | '\f1d5' => 'tencent-weibo', |
| 472 | '\f1d6' => 'qq', |
| 473 | '\f1d7' => 'weixin', |
| 474 | '\f1d8' => 'paper-plane', |
| 475 | '\f1d9' => 'paper-plane-o', |
| 476 | '\f1da' => 'history', |
| 477 | '\f1db' => 'circle-thin', |
| 478 | '\f1dc' => 'header', |
| 479 | '\f1dd' => 'paragraph', |
| 480 | '\f1de' => 'sliders', |
| 481 | '\f1e0' => 'share-alt', |
| 482 | '\f1e1' => 'share-alt-square', |
| 483 | '\f1e2' => 'bomb', |
| 484 | '\f1e3' => 'futbol-o', |
| 485 | '\f1e4' => 'tty', |
| 486 | '\f1e5' => 'binoculars', |
| 487 | '\f1e6' => 'plug', |
| 488 | '\f1e7' => 'slideshare', |
| 489 | '\f1e8' => 'twitch', |
| 490 | '\f1e9' => 'yelp', |
| 491 | '\f1ea' => 'newspaper-o', |
| 492 | '\f1eb' => 'wifi', |
| 493 | '\f1ec' => 'calculator', |
| 494 | '\f1ed' => 'paypal', |
| 495 | '\f1ee' => 'google-wallet', |
| 496 | '\f1f0' => 'cc-visa', |
| 497 | '\f1f1' => 'cc-mastercard', |
| 498 | '\f1f2' => 'cc-discover', |
| 499 | '\f1f3' => 'cc-amex', |
| 500 | '\f1f4' => 'cc-paypal', |
| 501 | '\f1f5' => 'cc-stripe', |
| 502 | '\f1f6' => 'bell-slash', |
| 503 | '\f1f7' => 'bell-slash-o', |
| 504 | '\f1f8' => 'trash', |
| 505 | '\f1f9' => 'copyright', |
| 506 | '\f1fa' => 'at', |
| 507 | '\f1fb' => 'eyedropper', |
| 508 | '\f1fc' => 'paint-brush', |
| 509 | '\f1fd' => 'birthday-cake', |
| 510 | '\f1fe' => 'area-chart', |
| 511 | '\f200' => 'pie-chart', |
| 512 | '\f201' => 'line-chart', |
| 513 | '\f202' => 'lastfm', |
| 514 | '\f203' => 'lastfm-square', |
| 515 | '\f204' => 'toggle-off', |
| 516 | '\f205' => 'toggle-on', |
| 517 | '\f206' => 'bicycle', |
| 518 | '\f207' => 'bus', |
| 519 | '\f208' => 'ioxhost', |
| 520 | '\f209' => 'angellist', |
| 521 | '\f20a' => 'cc', |
| 522 | '\f20b' => 'ils', |
| 523 | '\f20c' => 'meanpath', |
| 524 | '\f20d' => 'buysellads', |
| 525 | '\f20e' => 'connectdevelop', |
| 526 | '\f210' => 'dashcube', |
| 527 | '\f211' => 'forumbee', |
| 528 | '\f212' => 'leanpub', |
| 529 | '\f213' => 'sellsy', |
| 530 | '\f214' => 'shirtsinbulk', |
| 531 | '\f215' => 'simplybuilt', |
| 532 | '\f216' => 'skyatlas', |
| 533 | '\f217' => 'cart-plus', |
| 534 | '\f218' => 'cart-arrow-down', |
| 535 | '\f219' => 'diamond', |
| 536 | '\f21a' => 'ship', |
| 537 | '\f21b' => 'user-secret', |
| 538 | '\f21c' => 'motorcycle', |
| 539 | '\f21d' => 'street-view', |
| 540 | '\f21e' => 'heartbeat', |
| 541 | '\f221' => 'venus', |
| 542 | '\f222' => 'mars', |
| 543 | '\f223' => 'mercury', |
| 544 | '\f224' => 'transgender', |
| 545 | '\f225' => 'transgender-alt', |
| 546 | '\f226' => 'venus-double', |
| 547 | '\f227' => 'mars-double', |
| 548 | '\f228' => 'venus-mars', |
| 549 | '\f229' => 'mars-stroke', |
| 550 | '\f22a' => 'mars-stroke-v', |
| 551 | '\f22b' => 'mars-stroke-h', |
| 552 | '\f22c' => 'neuter', |
| 553 | '\f22d' => 'genderless', |
| 554 | '\f230' => 'facebook-official', |
| 555 | '\f231' => 'pinterest-p', |
| 556 | '\f232' => 'whatsapp', |
| 557 | '\f233' => 'server', |
| 558 | '\f234' => 'user-plus', |
| 559 | '\f235' => 'user-times', |
| 560 | '\f236' => 'bed', |
| 561 | '\f237' => 'viacoin', |
| 562 | '\f238' => 'train', |
| 563 | '\f239' => 'subway', |
| 564 | '\f23a' => 'medium', |
| 565 | '\f23b' => 'y-combinator', |
| 566 | '\f23c' => 'optin-monster', |
| 567 | '\f23d' => 'opencart', |
| 568 | '\f23e' => 'expeditedssl', |
| 569 | '\f240' => 'battery-full', |
| 570 | '\f241' => 'battery-three-quarters', |
| 571 | '\f242' => 'battery-half', |
| 572 | '\f243' => 'battery-quarter', |
| 573 | '\f244' => 'battery-empty', |
| 574 | '\f245' => 'mouse-pointer', |
| 575 | '\f246' => 'i-cursor', |
| 576 | '\f247' => 'object-group', |
| 577 | '\f248' => 'object-ungroup', |
| 578 | '\f249' => 'sticky-note', |
| 579 | '\f24a' => 'sticky-note-o', |
| 580 | '\f24b' => 'cc-jcb', |
| 581 | '\f24c' => 'cc-diners-club', |
| 582 | '\f24d' => 'clone', |
| 583 | '\f24e' => 'balance-scale', |
| 584 | '\f250' => 'hourglass-o', |
| 585 | '\f251' => 'hourglass-start', |
| 586 | '\f252' => 'hourglass-half', |
| 587 | '\f253' => 'hourglass-end', |
| 588 | '\f254' => 'hourglass', |
| 589 | '\f255' => 'hand-rock-o', |
| 590 | '\f256' => 'hand-paper-o', |
| 591 | '\f257' => 'hand-scissors-o', |
| 592 | '\f258' => 'hand-lizard-o', |
| 593 | '\f259' => 'hand-spock-o', |
| 594 | '\f25a' => 'hand-pointer-o', |
| 595 | '\f25b' => 'hand-peace-o', |
| 596 | '\f25c' => 'trademark', |
| 597 | '\f25d' => 'registered', |
| 598 | '\f25e' => 'creative-commons', |
| 599 | '\f260' => 'gg', |
| 600 | '\f261' => 'gg-circle', |
| 601 | '\f262' => 'tripadvisor', |
| 602 | '\f263' => 'odnoklassniki', |
| 603 | '\f264' => 'odnoklassniki-square', |
| 604 | '\f265' => 'get-pocket', |
| 605 | '\f266' => 'wikipedia-w', |
| 606 | '\f267' => 'safari', |
| 607 | '\f268' => 'chrome', |
| 608 | '\f269' => 'firefox', |
| 609 | '\f26a' => 'opera', |
| 610 | '\f26b' => 'internet-explorer', |
| 611 | '\f26c' => 'television', |
| 612 | '\f26d' => 'contao', |
| 613 | '\f26e' => '500px', |
| 614 | '\f270' => 'amazon', |
| 615 | '\f271' => 'calendar-plus-o', |
| 616 | '\f272' => 'calendar-minus-o', |
| 617 | '\f273' => 'calendar-times-o', |
| 618 | '\f274' => 'calendar-check-o', |
| 619 | '\f275' => 'industry', |
| 620 | '\f276' => 'map-pin', |
| 621 | '\f277' => 'map-signs', |
| 622 | '\f278' => 'map-o', |
| 623 | '\f279' => 'map', |
| 624 | '\f27a' => 'commenting', |
| 625 | '\f27b' => 'commenting-o', |
| 626 | '\f27c' => 'houzz', |
| 627 | '\f27d' => 'vimeo', |
| 628 | '\f27e' => 'black-tie', |
| 629 | '\f280' => 'fonticons', |
| 630 | '\f281' => 'reddit-alien', |
| 631 | '\f282' => 'edge', |
| 632 | '\f283' => 'credit-card-alt', |
| 633 | '\f284' => 'codiepie', |
| 634 | '\f285' => 'modx', |
| 635 | '\f286' => 'fort-awesome', |
| 636 | '\f287' => 'usb', |
| 637 | '\f288' => 'product-hunt', |
| 638 | '\f289' => 'mixcloud', |
| 639 | '\f28a' => 'scribd', |
| 640 | '\f28b' => 'pause-circle', |
| 641 | '\f28c' => 'pause-circle-o', |
| 642 | '\f28d' => 'stop-circle', |
| 643 | '\f28e' => 'stop-circle-o', |
| 644 | '\f290' => 'shopping-bag', |
| 645 | '\f291' => 'shopping-basket', |
| 646 | '\f292' => 'hashtag', |
| 647 | '\f293' => 'bluetooth', |
| 648 | '\f294' => 'bluetooth-b', |
| 649 | '\f295' => 'percent', |
| 650 | '\f296' => 'gitlab', |
| 651 | '\f297' => 'wpbeginner', |
| 652 | '\f298' => 'wpforms', |
| 653 | '\f299' => 'envira', |
| 654 | '\f29a' => 'universal-access', |
| 655 | '\f29b' => 'wheelchair-alt', |
| 656 | '\f29c' => 'question-circle-o', |
| 657 | '\f29d' => 'blind', |
| 658 | '\f29e' => 'audio-description', |
| 659 | '\f2a0' => 'volume-control-phone', |
| 660 | '\f2a1' => 'braille', |
| 661 | '\f2a2' => 'assistive-listening-systems', |
| 662 | '\f2a3' => 'american-sign-language-interpreting', |
| 663 | '\f2a4' => 'deaf', |
| 664 | '\f2a5' => 'glide', |
| 665 | '\f2a6' => 'glide-g', |
| 666 | '\f2a7' => 'sign-language', |
| 667 | '\f2a8' => 'low-vision', |
| 668 | '\f2a9' => 'viadeo', |
| 669 | '\f2aa' => 'viadeo-square', |
| 670 | '\f2ab' => 'snapchat', |
| 671 | '\f2ac' => 'snapchat-ghost', |
| 672 | '\f2ad' => 'snapchat-square', |
| 673 | '\f2ae' => 'pied-piper', |
| 674 | '\f2b0' => 'first-order', |
| 675 | '\f2b1' => 'yoast', |
| 676 | '\f2b2' => 'themeisle', |
| 677 | '\f2b3' => 'google-plus-official', |
| 678 | '\f2b4' => 'font-awesome', |
| 679 | ), |
| 680 | 'Dashicons' => array( |
| 681 | '\f100' => 'admin-appearance', |
| 682 | '\f101' => 'admin-comments', |
| 683 | '\f102' => 'admin-home', |
| 684 | '\f104' => 'admin-media', |
| 685 | '\f105' => 'admin-page', |
| 686 | '\f106' => 'admin-plugins', |
| 687 | '\f107' => 'admin-tools', |
| 688 | '\f108' => 'admin-settings', |
| 689 | '\f110' => 'admin-users', |
| 690 | '\f111' => 'admin-generic', |
| 691 | '\f112' => 'admin-network', |
| 692 | '\f115' => 'welcome-view-site', |
| 693 | '\f116' => 'welcome-widgets-menus', |
| 694 | '\f117' => 'welcome-comments', |
| 695 | '\f118' => 'welcome-learn-more', |
| 696 | '\f120' => 'wordpress', |
| 697 | '\f122' => 'format-quote', |
| 698 | '\f123' => 'format-aside', |
| 699 | '\f125' => 'format-chat', |
| 700 | '\f126' => 'format-video', |
| 701 | '\f127' => 'format-audio', |
| 702 | '\f128' => 'format-image', |
| 703 | '\f130' => 'format-status', |
| 704 | '\f132' => 'plus', |
| 705 | '\f133' => 'welcome-add-page', |
| 706 | '\f134' => 'align-center', |
| 707 | '\f135' => 'align-left', |
| 708 | '\f136' => 'align-right', |
| 709 | '\f138' => 'align-none', |
| 710 | '\f139' => 'arrow-right', |
| 711 | '\f140' => 'arrow-down', |
| 712 | '\f141' => 'arrow-left', |
| 713 | '\f142' => 'arrow-up', |
| 714 | '\f145' => 'calendar', |
| 715 | '\f147' => 'yes', |
| 716 | '\f148' => 'admin-collapse', |
| 717 | '\f153' => 'dismiss', |
| 718 | '\f154' => 'star-empty', |
| 719 | '\f155' => 'star-filled', |
| 720 | '\f156' => 'sort', |
| 721 | '\f157' => 'pressthis', |
| 722 | '\f158' => 'no', |
| 723 | '\f159' => 'marker', |
| 724 | '\f160' => 'lock', |
| 725 | '\f161' => 'format-gallery', |
| 726 | '\f163' => 'list-view', |
| 727 | '\f165' => 'image-crop', |
| 728 | '\f166' => 'image-rotate-left', |
| 729 | '\f167' => 'image-rotate-right', |
| 730 | '\f168' => 'image-flip-vertical', |
| 731 | '\f169' => 'image-flip-horizontal', |
| 732 | '\f171' => 'undo', |
| 733 | '\f172' => 'redo', |
| 734 | '\f173' => 'post-status', |
| 735 | '\f174' => 'cart', |
| 736 | '\f175' => 'feedback', |
| 737 | '\f176' => 'cloud', |
| 738 | '\f177' => 'visibility', |
| 739 | '\f178' => 'vault', |
| 740 | '\f179' => 'search', |
| 741 | '\f180' => 'screenoptions', |
| 742 | '\f181' => 'slides', |
| 743 | '\f183' => 'analytics', |
| 744 | '\f184' => 'chart-pie', |
| 745 | '\f185' => 'chart-bar', |
| 746 | '\f200' => 'editor-bold', |
| 747 | '\f201' => 'editor-italic', |
| 748 | '\f203' => 'editor-ul', |
| 749 | '\f204' => 'editor-ol', |
| 750 | '\f205' => 'editor-quote', |
| 751 | '\f206' => 'editor-alignleft', |
| 752 | '\f207' => 'editor-aligncenter', |
| 753 | '\f208' => 'editor-alignright', |
| 754 | '\f209' => 'editor-insertmore', |
| 755 | '\f210' => 'editor-spellcheck', |
| 756 | '\f212' => 'editor-kitchensink', |
| 757 | '\f213' => 'editor-underline', |
| 758 | '\f214' => 'editor-justify', |
| 759 | '\f215' => 'editor-textcolor', |
| 760 | '\f216' => 'editor-paste-word', |
| 761 | '\f217' => 'editor-paste-text', |
| 762 | '\f218' => 'editor-removeformatting', |
| 763 | '\f219' => 'editor-video', |
| 764 | '\f220' => 'editor-customchar', |
| 765 | '\f221' => 'editor-outdent', |
| 766 | '\f222' => 'editor-indent', |
| 767 | '\f223' => 'editor-help', |
| 768 | '\f224' => 'editor-strikethrough', |
| 769 | '\f225' => 'editor-unlink', |
| 770 | '\f226' => 'dashboard', |
| 771 | '\f227' => 'flag', |
| 772 | '\f229' => 'leftright', |
| 773 | '\f230' => 'location', |
| 774 | '\f231' => 'location-alt', |
| 775 | '\f232' => 'images-alt', |
| 776 | '\f233' => 'images-alt2', |
| 777 | '\f234' => 'video-alt', |
| 778 | '\f235' => 'video-alt2', |
| 779 | '\f236' => 'video-alt3', |
| 780 | '\f237' => 'share1', |
| 781 | '\f238' => 'chart-line', |
| 782 | '\f239' => 'chart-area', |
| 783 | '\f240' => 'share-alt', |
| 784 | '\f242' => 'share-alt2', |
| 785 | '\f301' => 'twitter', |
| 786 | '\f303' => 'rss', |
| 787 | '\f304' => 'facebook', |
| 788 | '\f305' => 'facebook-alt', |
| 789 | '\f306' => 'camera', |
| 790 | '\f307' => 'groups', |
| 791 | '\f308' => 'hammer', |
| 792 | '\f309' => 'art', |
| 793 | '\f310' => 'migrate', |
| 794 | '\f311' => 'performance', |
| 795 | '\f312' => 'products', |
| 796 | '\f313' => 'awards', |
| 797 | '\f314' => 'forms', |
| 798 | '\f316' => 'download', |
| 799 | '\f317' => 'upload', |
| 800 | '\f318' => 'category', |
| 801 | '\f319' => 'admin-site', |
| 802 | '\f320' => 'editor-rtl', |
| 803 | '\f321' => 'backup', |
| 804 | '\f322' => 'portfolio', |
| 805 | '\f323' => 'tag', |
| 806 | '\f324' => 'wordpress-alt', |
| 807 | '\f325' => 'networking', |
| 808 | '\f326' => 'translation', |
| 809 | '\f328' => 'smiley', |
| 810 | '\f330' => 'book', |
| 811 | '\f331' => 'book-alt', |
| 812 | '\f332' => 'shield', |
| 813 | '\f333' => 'menu', |
| 814 | '\f334' => 'shield-alt', |
| 815 | '\f335' => 'no-alt', |
| 816 | '\f336' => 'id', |
| 817 | '\f337' => 'id-alt', |
| 818 | '\f338' => 'businessman', |
| 819 | '\f339' => 'lightbulb', |
| 820 | '\f340' => 'arrow-left-alt', |
| 821 | '\f341' => 'arrow-left-alt2', |
| 822 | '\f342' => 'arrow-up-alt', |
| 823 | '\f343' => 'arrow-up-alt2', |
| 824 | '\f344' => 'arrow-right-alt', |
| 825 | '\f345' => 'arrow-right-alt2', |
| 826 | '\f346' => 'arrow-down-alt', |
| 827 | '\f347' => 'arrow-down-alt2', |
| 828 | '\f348' => 'info', |
| 829 | '\f459' => 'star-half', |
| 830 | '\f460' => 'minus', |
| 831 | '\f462' => 'googleplus', |
| 832 | '\f463' => 'update', |
| 833 | '\f464' => 'edit', |
| 834 | '\f465' => 'email', |
| 835 | '\f466' => 'email-alt', |
| 836 | '\f468' => 'sos', |
| 837 | '\f469' => 'clock', |
| 838 | '\f470' => 'smartphone', |
| 839 | '\f471' => 'tablet', |
| 840 | '\f472' => 'desktop', |
| 841 | '\f473' => 'testimonial', |
| 842 | '\f474' => 'editor-break', |
| 843 | '\f475' => 'editor-code', |
| 844 | '\f476' => 'editor-paragraph', |
| 845 | '\f478' => 'text', |
| 846 | '\f479' => 'tagcloud', |
| 847 | '\f480' => 'archive', |
| 848 | '\f481' => 'clipboard', |
| 849 | '\f482' => 'microphone', |
| 850 | '\f483' => 'universal-access', |
| 851 | '\f484' => 'nametag', |
| 852 | '\f486' => 'tickets', |
| 853 | '\f487' => 'heart', |
| 854 | '\f488' => 'megaphone', |
| 855 | '\f489' => 'schedule', |
| 856 | '\f490' => 'media-video', |
| 857 | '\f491' => 'media-text', |
| 858 | '\f492' => 'playlist-audio', |
| 859 | '\f493' => 'playlist-video', |
| 860 | '\f495' => 'media-spreadsheet', |
| 861 | '\f496' => 'media-interactive', |
| 862 | '\f497' => 'media-document', |
| 863 | '\f498' => 'media-default', |
| 864 | '\f499' => 'media-code', |
| 865 | '\f500' => 'media-audio', |
| 866 | '\f501' => 'media-archive', |
| 867 | '\f502' => 'plus-alt', |
| 868 | '\f503' => 'randomize', |
| 869 | '\f504' => 'external', |
| 870 | '\f506' => 'editor-contract', |
| 871 | '\f507' => 'universal-access-alt', |
| 872 | '\f508' => 'calendar-alt', |
| 873 | '\f509' => 'grid-view', |
| 874 | '\f510' => 'index-card', |
| 875 | '\f511' => 'carrot', |
| 876 | '\f512' => 'building', |
| 877 | '\f513' => 'store', |
| 878 | '\f514' => 'album', |
| 879 | '\f515' => 'controls-repeat', |
| 880 | '\f516' => 'controls-skipback', |
| 881 | '\f517' => 'controls-skipforward', |
| 882 | '\f518' => 'controls-back', |
| 883 | '\f519' => 'controls-forward', |
| 884 | '\f520' => 'controls-volumeoff', |
| 885 | '\f521' => 'controls-volumeon', |
| 886 | '\f522' => 'controls-play', |
| 887 | '\f523' => 'controls-pause', |
| 888 | '\f524' => 'tickets-alt', |
| 889 | '\f525' => 'phone', |
| 890 | '\f526' => 'money', |
| 891 | '\f527' => 'palmtree', |
| 892 | '\f528' => 'unlock', |
| 893 | '\f529' => 'thumbs-up', |
| 894 | '\f530' => 'hidden', |
| 895 | '\f531' => 'image-rotate', |
| 896 | '\f533' => 'image-filter', |
| 897 | '\f534' => 'warning', |
| 898 | '\f535' => 'editor-table', |
| 899 | '\f536' => 'filter', |
| 900 | '\f537' => 'sticky', |
| 901 | '\f538' => 'layout', |
| 902 | '\f540' => 'admin-customizer', |
| 903 | '\f541' => 'admin-multisite', |
| 904 | '\f542' => 'thumbs-down', |
| 905 | '\f543' => 'plus-alt2', |
| 906 | '\f545' => 'move', |
| 907 | '\f546' => 'paperclip', |
| 908 | '\f547' => 'laptop', |
| 909 | ), |
| 910 | ) |
| 911 | ); |
| 912 | |
| 913 | |
| 914 | /** |
| 915 | * Returns single instance of the class |
| 916 | * |
| 917 | * @return YIT_Icons |
| 918 | * @since 1.0.0 |
| 919 | * @author Leanza Francesco <leanzafrancesco@gmail.com> |
| 920 | */ |
| 921 | public static function get_instance() { |
| 922 | return isset( self::$_instance ) ? self::$_instance : self::$_instance = new self(); |
| 923 | } |
| 924 | |
| 925 | /** |
| 926 | * @since 1.0.0 |
| 927 | * @access protected |
| 928 | * @author Leanza Francesco <leanzafrancesco@gmail.com> |
| 929 | */ |
| 930 | private function __construct() { |
| 931 | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 ); |
| 932 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 ); |
| 933 | } |
| 934 | |
| 935 | /** |
| 936 | * __get function. |
| 937 | * |
| 938 | * @param string $key |
| 939 | * |
| 940 | * @return mixed |
| 941 | */ |
| 942 | public function __get( $key ) { |
| 943 | $value = isset( $this->_data[ $key ] ) ? $this->_data[ $key ] : false; |
| 944 | |
| 945 | return $value; |
| 946 | } |
| 947 | |
| 948 | /** |
| 949 | * __isset function. |
| 950 | * |
| 951 | * @param string $key |
| 952 | * |
| 953 | * @return bool |
| 954 | */ |
| 955 | public function __isset( $key ) { |
| 956 | return isset( $this->_data[ $key ] ); |
| 957 | } |
| 958 | |
| 959 | public function get_icons( $filter_icons = '' ) { |
| 960 | $icons = $this->icons; |
| 961 | if ( !empty( $filter_icons ) ) { |
| 962 | $icons = apply_filters( 'yith_plugin_fw_icons_field_icons_' . sanitize_key( $filter_icons ), $icons ); |
| 963 | } |
| 964 | |
| 965 | return $icons; |
| 966 | } |
| 967 | |
| 968 | /** |
| 969 | * @param $icon_string |
| 970 | * |
| 971 | * @param string $filter_icons |
| 972 | * |
| 973 | * @return string |
| 974 | */ |
| 975 | public function get_icon_data( $icon_string, $filter_icons = '' ) { |
| 976 | $icon_data = ''; |
| 977 | if ( $icon_string ) { |
| 978 | $icon_array = explode( ':', $icon_string ); |
| 979 | |
| 980 | if ( count( $icon_array ) < 2 ) { |
| 981 | return $icon_data; |
| 982 | } |
| 983 | |
| 984 | $font_name = $icon_array[ 0 ]; |
| 985 | $icon_name = $icon_array[ 1 ]; |
| 986 | |
| 987 | $icons = $this->get_icons( $filter_icons ); |
| 988 | if ( array_key_exists( $font_name, $icons ) ) { |
| 989 | $icon_key = array_search( $icon_name, $icons[ $font_name ] ); |
| 990 | $icon_code = '&#x' . str_replace( '\\', '', $icon_key ); |
| 991 | |
| 992 | $icon_data = 'data-font="' . esc_attr( $font_name ) . '" data-name="' . esc_attr( $icon_name ) . '" data-key="' . esc_attr( $icon_key ) . '" data-icon="' . $icon_code . '"'; |
| 993 | } |
| 994 | } |
| 995 | |
| 996 | return $icon_data; |
| 997 | } |
| 998 | |
| 999 | /** |
| 1000 | * Retrieves the font awesome array |
| 1001 | * the first time retrieves the array by the Font Awesome CSS |
| 1002 | * [utility method] |
| 1003 | * |
| 1004 | * @return array |
| 1005 | */ |
| 1006 | private function _get_font_awesome_array() { |
| 1007 | $font_awesome_list = get_option( 'yit_font_awesome_list', array() ); |
| 1008 | $font_awesome_version = $this->font_awesome_version; |
| 1009 | |
| 1010 | $font_awesome_array = array(); |
| 1011 | |
| 1012 | if ( !empty( $font_awesome_list[ $font_awesome_version ] ) ) { |
| 1013 | $font_awesome_array = $font_awesome_list[ $font_awesome_version ]; |
| 1014 | } else { |
| 1015 | // Create the array by css |
| 1016 | $font_awesome_file = "https://maxcdn.bootstrapcdn.com/font-awesome/{$font_awesome_version}/css/font-awesome.min.css"; |
| 1017 | |
| 1018 | $pattern = '/\.(fa-(?:\w+(?:-)?)+):before{content:"\\\\(....)"}/'; |
| 1019 | $subject = file_get_contents( $font_awesome_file ); |
| 1020 | preg_match_all( $pattern, $subject, $matches, PREG_SET_ORDER ); |
| 1021 | foreach ( $matches as $match ) { |
| 1022 | $font_awesome_array[ $match[ 2 ] ] = $match[ 1 ]; |
| 1023 | } |
| 1024 | ksort( $font_awesome_array ); |
| 1025 | |
| 1026 | $font_awesome_list[ $font_awesome_version ] = $font_awesome_array; |
| 1027 | update_option( 'yit_font_awesome_list', $font_awesome_list ); |
| 1028 | } |
| 1029 | |
| 1030 | return $font_awesome_array; |
| 1031 | } |
| 1032 | |
| 1033 | /** |
| 1034 | * Retrieves the dashicons array |
| 1035 | * the first time retrieves the array by the Dashicons CSS |
| 1036 | * [utility method] |
| 1037 | * |
| 1038 | * @return array |
| 1039 | */ |
| 1040 | private function _get_dashicons_array() { |
| 1041 | $dashicons_list = get_option( 'yit_dashicons_list', array() ); |
| 1042 | |
| 1043 | $dashicons_array = array(); |
| 1044 | if ( false && !empty( $dashicons_list ) ) { |
| 1045 | $dashicons_array = $dashicons_list; |
| 1046 | } else { |
| 1047 | // Create the array by css |
| 1048 | $file = "https://s.w.org/wp-includes/css/dashicons.min.css"; |
| 1049 | |
| 1050 | $pattern = '/\.dashicons-((?:\w+(?:-)?)+):before{content:"\\\\(....)"/'; |
| 1051 | $pattern = '/\.dashicons-((?:\w+(?:-)?)+):before.............../'; |
| 1052 | $subject = file_get_contents( $file ); |
| 1053 | preg_match_all( $pattern, $subject, $matches, PREG_SET_ORDER ); |
| 1054 | |
| 1055 | foreach ( $matches as $match ) { |
| 1056 | $code = str_replace( '.dashicons-' . $match[ 1 ] . ':before{content:"\\', '', $match[ 0 ] ); |
| 1057 | if ( strlen( $code ) == 4 ) |
| 1058 | $dashicons_array[ $code ] = $match[ 1 ]; |
| 1059 | } |
| 1060 | ksort( $dashicons_array ); |
| 1061 | } |
| 1062 | |
| 1063 | return $dashicons_array; |
| 1064 | } |
| 1065 | |
| 1066 | /** |
| 1067 | * Enqueue Scripts |
| 1068 | * |
| 1069 | * @author Leanza Francesco <leanzafrancesco@gmail.com> |
| 1070 | */ |
| 1071 | public function enqueue_scripts() { |
| 1072 | wp_register_style( 'font-awesome', "https://maxcdn.bootstrapcdn.com/font-awesome/{$this->font_awesome_version}/css/font-awesome.min.css", array(), $this->font_awesome_version ); |
| 1073 | |
| 1074 | $font_awesome_inline = $this->get_inline_scripts( 'font-awesome' ); |
| 1075 | wp_add_inline_style( 'font-awesome', $font_awesome_inline ); |
| 1076 | |
| 1077 | $dashicons_inline = $this->get_inline_scripts( 'dashicons' ); |
| 1078 | wp_add_inline_style( 'dashicons', $dashicons_inline ); |
| 1079 | } |
| 1080 | |
| 1081 | /** |
| 1082 | * Return the icon HTML from icon_string passed |
| 1083 | * |
| 1084 | * @param string|array $icon |
| 1085 | * @param array $args |
| 1086 | * |
| 1087 | * @return string |
| 1088 | */ |
| 1089 | public function get_icon( $icon = '', $args = array() ) { |
| 1090 | $icon = is_array( $icon ) && isset( $icon[ 'icon' ] ) ? $icon[ 'icon' ] : $icon; |
| 1091 | $icon_html = ""; |
| 1092 | if ( $icon ) { |
| 1093 | $default_args = array( |
| 1094 | 'html_tag' => 'span', |
| 1095 | 'class' => '', |
| 1096 | 'style' => '', |
| 1097 | 'filter_icons' => '' |
| 1098 | ); |
| 1099 | $args = wp_parse_args( $args, $default_args ); |
| 1100 | /** |
| 1101 | * @var string $html_tag |
| 1102 | * @var string $class |
| 1103 | * @var string $style |
| 1104 | * @var string $filter_icons |
| 1105 | */ |
| 1106 | extract( $args ); |
| 1107 | |
| 1108 | if ( $icon_data = $this->get_icon_data( $icon, $filter_icons ) ) { |
| 1109 | $icon_html = "<$html_tag class=\"$class\" style=\"$style\" $icon_data></$html_tag>"; |
| 1110 | } |
| 1111 | |
| 1112 | } |
| 1113 | |
| 1114 | return $icon_html; |
| 1115 | } |
| 1116 | |
| 1117 | /** |
| 1118 | * Get inline scripts |
| 1119 | * |
| 1120 | * @param $slug |
| 1121 | * |
| 1122 | * @return string |
| 1123 | */ |
| 1124 | public function get_inline_scripts( $slug ) { |
| 1125 | $css = ''; |
| 1126 | switch ( $slug ) { |
| 1127 | case 'font-awesome': |
| 1128 | $css = '[data-font="FontAwesome"]:before {font-family: \'FontAwesome\' !important;content: attr(data-icon) !important;speak: none !important;font-weight: normal !important;font-variant: normal !important;text-transform: none !important;line-height: 1 !important;font-style: normal !important;-webkit-font-smoothing: antialiased !important;-moz-osx-font-smoothing: grayscale !important;}'; |
| 1129 | break; |
| 1130 | case 'dashicons': |
| 1131 | $css = '[data-font="Dashicons"]:before {font-family: \'Dashicons\' !important;content: attr(data-icon) !important;speak: none !important;font-weight: normal !important;font-variant: normal !important;text-transform: none !important;line-height: 1 !important;font-style: normal !important;-webkit-font-smoothing: antialiased !important;-moz-osx-font-smoothing: grayscale !important;}'; |
| 1132 | } |
| 1133 | |
| 1134 | return $css; |
| 1135 | } |
| 1136 | |
| 1137 | } |
| 1138 | } |
| 1139 | if( ! function_exists( 'YIT_Icons' ) ){ |
| 1140 | function YIT_Icons() { |
| 1141 | return YIT_Icons::get_instance(); |
| 1142 | } |
| 1143 | } |
| 1144 | |
| 1145 | YIT_Icons(); |