Guest User

Untitled

a guest
Dec 14th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Adding the Themify icons
  5. */
  6.  
  7. add_action( 'wpb_wmca_add_custom_icons', 'wpb_wmca_add_themify_icons' );
  8. add_action( 'wpb_wmca_icon_set', 'wpb_wmca_add_themify_icons_list' );
  9. add_action( 'wpb_wmca_icon_set_init', 'wpb_wmca_themify_icon_set_init' );
  10.  
  11.  
  12. /**
  13. * Load Themify icons
  14. */
  15.  
  16. function wpb_wmca_add_themify_icons(){
  17. wp_enqueue_style( 'wpb_wmca_themify_icons', plugins_url('admin/assets/css/themify-icons.css', __FILE__), '', '1.0' );
  18. }
  19.  
  20. /**
  21. * Themify icons List
  22. */
  23.  
  24. function wpb_wmca_add_themify_icons_list(){
  25. $icons = [];
  26. $themify_icons = file(WPB_WAMC_PATH . 'admin/assets/css/themify-icons.css');
  27.  
  28. if( !empty($themify_icons) ){
  29. foreach($themify_icons as $themify_icon) {
  30. if(stripos($themify_icon, ".ti-") === 0) {
  31. $l = explode(":", $themify_icon);
  32. $icons[str_replace(".", "", $l[0])] = str_replace(".", "", $l[0]);
  33. }
  34. }
  35. }
  36.  
  37. if( !empty($icons) ){
  38. ?>
  39. <div class="ti-set icon-set">
  40. <?php
  41. if( function_exists('wpb_wmca_icons_search_box') ){
  42. wpb_wmca_icons_search_box();
  43. }
  44. ?>
  45. <ul class="wpb_wmca_icons_list">
  46. <?php
  47. foreach ($icons as $icon ) {
  48. printf('<li data-class="%s" class="%s"></li>', esc_attr( $icon ), esc_attr( $icon ));
  49. }
  50. ?>
  51. </ul>
  52. </div>
  53. <?php
  54. }
  55. }
  56.  
  57. /**
  58. * Themify icons Init
  59. */
  60.  
  61. function wpb_wmca_themify_icon_set_init(){
  62. echo "'ti' : 'Themify Icons',";
  63. }
Add Comment
Please, Sign In to add comment