icon-migration.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. //https://github.com/FortAwesome/Font-Awesome/wiki/Upgrading-from-3.2.1-to-4
  3. $icon_migrations = array(
  4. 'ban-circle' => 'ban',
  5. 'bar-chart' => 'bar-chart-o',
  6. 'beaker' => 'flask',
  7. 'bell' => 'bell-o',
  8. 'bell-alt' => 'bell',
  9. 'bitbucket-sign' => 'bitbucket-square',
  10. 'bookmark-empty' => 'bookmark-o',
  11. 'building' => 'building-o',
  12. 'calendar-empty' => 'calendar-o',
  13. 'check-empty' => 'square-o',
  14. 'check-minus' => 'minus-square-o',
  15. 'check-sign' => 'check-square',
  16. 'check' => 'check-square-o',
  17. 'chevron-sign-down' => 'chevron-down',
  18. 'chevron-sign-left' => 'chevron-left',
  19. 'chevron-sign-right' => 'chevron-right',
  20. 'chevron-sign-up' => 'chevron-up',
  21. 'circle-arrow-down' => 'arrow-circle-down',
  22. 'circle-arrow-left' => 'arrow-circle-left',
  23. 'circle-arrow-right' => 'arrow-circle-right',
  24. 'circle-arrow-up' => 'arrow-circle-up',
  25. 'circle-blank' => 'circle-o',
  26. 'cny' => 'rub',
  27. 'collapse-alt' => 'minus-square-o',
  28. 'collapse-top' => 'caret-square-o-up',
  29. 'collapse' => 'caret-square-o-down',
  30. 'comment-alt' => 'comment-o',
  31. 'comments-alt' => 'comments-o',
  32. 'copy' => 'files-o',
  33. 'cut' => 'scissors',
  34. 'dashboard' => 'tachometer',
  35. 'double-angle-down' => 'angle-double-down',
  36. 'double-angle-left' => 'angle-double-left',
  37. 'double-angle-right' => 'angle-double-right',
  38. 'double-angle-up' => 'angle-double-up',
  39. 'download' => 'arrow-circle-o-down',
  40. 'download-alt' => 'download',
  41. 'edit-sign' => 'pencil-square',
  42. 'edit' => 'pencil-square-o',
  43. 'ellipsis-horizontal' => 'ellipsis-h',
  44. 'ellipsis-vertical' => 'ellipsis-v',
  45. 'envelope-alt' => 'envelope-o',
  46. 'exclamation-sign' => 'exclamation-circle',
  47. 'expand-alt' => 'plus-square-o',
  48. 'expand' => 'caret-square-o-right',
  49. 'external-link-sign' => 'external-link-square',
  50. 'eye-close' => 'eye-slash',
  51. 'eye-open' => 'eye',
  52. 'facebook-sign' => 'facebook-square',
  53. 'facetime-video' => 'video-camera',
  54. 'file-alt' => 'file-o',
  55. 'file-text-alt' => 'file-text-o',
  56. 'flag-alt' => 'flag-o',
  57. 'folder-close-alt' => 'folder-o',
  58. 'folder-close' => 'folder',
  59. 'folder-open-alt' => 'folder-open-o',
  60. 'food' => 'cutlery',
  61. 'frown' => 'frown-o',
  62. 'fullscreen' => 'arrows-alt',
  63. 'github-sign' => 'github-square',
  64. 'google-plus-sign' => 'google-plus-square',
  65. 'group' => 'users',
  66. 'h-sign' => 'h-square',
  67. 'hand-down' => 'hand-o-down',
  68. 'hand-left' => 'hand-o-left',
  69. 'hand-right' => 'hand-o-right',
  70. 'hand-up' => 'hand-o-up',
  71. 'hdd' => 'hdd-o',
  72. 'heart-empty' => 'heart-o',
  73. 'hospital' => 'hospital-o',
  74. 'indent-left' => 'outdent',
  75. 'indent-right' => 'indent',
  76. 'info-sign' => 'info-circle',
  77. 'keyboard' => 'keyboard-o',
  78. 'legal' => 'gavel',
  79. 'lemon' => 'lemon-o',
  80. 'lightbulb' => 'lightbulb-o',
  81. 'linkedin-sign' => 'linkedin-square',
  82. 'meh' => 'meh-o',
  83. 'microphone-off' => 'microphone-slash',
  84. 'minus-sign-alt' => 'minus-square',
  85. 'minus-sign' => 'minus-circle',
  86. 'mobile-phone' => 'mobile',
  87. 'moon' => 'moon-o',
  88. 'move' => 'arrows',
  89. 'off' => 'power-off',
  90. 'ok-circle' => 'check-circle-o',
  91. 'ok-sign' => 'check-circle',
  92. 'ok' => 'check',
  93. 'paper-clip' => 'paperclip',
  94. 'paste' => 'clipboard',
  95. 'phone-sign' => 'phone-square',
  96. 'picture' => 'picture-o',
  97. 'pinterest-sign' => 'pinterest-square',
  98. 'play-circle' => 'play-circle-o',
  99. 'play-sign' => 'play-circle',
  100. 'plus-sign-alt' => 'plus-square',
  101. 'plus-sign' => 'plus-circle',
  102. 'pushpin' => 'thumb-tack',
  103. 'question-sign' => 'question-circle',
  104. 'remove-circle' => 'times-circle-o',
  105. 'remove-sign' => 'times-circle',
  106. 'remove' => 'times',
  107. 'reorder' => 'bars',
  108. 'resize-full' => 'expand',
  109. 'resize-horizontal' => 'arrows-h',
  110. 'resize-small' => 'compress',
  111. 'resize-vertical' => 'arrows-v',
  112. 'rss-sign' => 'rss-square',
  113. 'save' => 'floppy-o',
  114. 'screenshot' => 'crosshairs',
  115. 'share-alt' => 'share',
  116. 'share-sign' => 'share-square',
  117. 'share' => 'share-square-o',
  118. 'sign-blank' => 'square',
  119. 'signin' => 'sign-in',
  120. 'signout' => 'sign-out',
  121. 'smile' => 'smile-o',
  122. 'sort-by-alphabet-alt' => 'sort-alpha-desc',
  123. 'sort-by-alphabet' => 'sort-alpha-asc',
  124. 'sort-by-attributes-alt' => 'sort-amount-desc',
  125. 'sort-by-attributes' => 'sort-amount-asc',
  126. 'sort-by-order-alt' => 'sort-numeric-desc',
  127. 'sort-by-order' => 'sort-numeric-asc',
  128. 'sort-down' => 'sort-desc',
  129. 'sort-up' => 'sort-asc',
  130. 'stackexchange' => 'stack-overflow',
  131. 'star-empty' => 'star-o',
  132. 'star-half-empty' => 'star-half-o',
  133. 'sun' => 'sun-o',
  134. 'thumbs-down-alt' => 'thumbs-o-down',
  135. 'thumbs-up-alt' => 'thumbs-o-up',
  136. 'time' => 'clock-o',
  137. 'trash' => 'trash-o',
  138. 'tumblr-sign' => 'tumblr-square',
  139. 'twitter-sign' => 'twitter-square',
  140. 'unlink' => 'chain-broken',
  141. 'upload' => 'arrow-circle-o-up',
  142. 'upload-alt' => 'upload',
  143. 'warning-sign' => 'exclamation-triangle',
  144. 'xing-sign' => 'xing-square',
  145. 'youtube-sign' => 'youtube-square',
  146. 'zoom-in' => 'search-plus',
  147. 'zoom-out' => 'search-minus',
  148. );
  149. function migrate_fontawesome_icon( $current ){
  150. global $icon_migrations;
  151. if ( strpos( $current, 'icon-' ) === false ) {
  152. return $current;
  153. }
  154. $old = preg_replace( '/^icon-/', '', $current );
  155. if ( isset($icon_migrations[ $old ] ) ) {
  156. $new = $icon_migrations[ $old ];
  157. }
  158. else {
  159. $new = $old;
  160. }
  161. return 'fa fa-'. $new;
  162. }
  163. add_filter('vantage_fontawesome_icon_name', 'migrate_fontawesome_icon');