icons-list.php 913 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class Vamtam_Icons_List {
  3. public function __construct() {
  4. add_shortcode( 'vamtam_icons_list', array( __CLASS__, 'shortcode' ) );
  5. }
  6. public static function shortcode() {
  7. FLBuilderIcons::enqueue_all_custom_icons_styles();
  8. wp_enqueue_style( 'font-awesome' );
  9. wp_enqueue_style( 'foundation-icons' );
  10. wp_enqueue_style( 'dashicons' );
  11. $sets = FLBuilderIcons::get_sets();
  12. $output = '';
  13. foreach ( $sets as $set ) {
  14. $output .= '<h3 class="textcenter">' . $set['name'] . '</h3>';
  15. $output .= '<table>';
  16. $output .= '<tr>';
  17. foreach ( $set['icons'] as $num => $icon ) {
  18. $output .= "<td><span class='{$set['prefix']} {$icon}' style='padding: 10px; font-size: 20px; line-height: 1'></span></td><td>{$icon}</td>";
  19. if ( $num % 3 == 2 ) {
  20. $output .= '</tr><tr>';
  21. }
  22. }
  23. $output .= '</tr>';
  24. $output .= '</table>';
  25. }
  26. return $output;
  27. }
  28. }
  29. new Vamtam_Icons_List();