Overview

Namespaces

  • EventPost
  • None

Classes

  • EventPost
  • EventPost\Categories
  • EventPost\DashIcons
  • EventPost\Settings
  • EventPost_Cal
  • EventPost_List
  • EventPost_Map
  • EventPost_Search
  • EventPost_Shortcodes
  • EventPostChild
  • EventPostMU
  • EventPostWeather

Functions

  • event_post_format_color
  • event_post_get_all_terms
  • eventdetails_block_init
  • EventPost
  • EventPost\product_event_tab
  • EventPost\woocommerce_product_tabs
  • EventPost\woocommerce_rich_result
  • eventpost_list_block_init
  • eventpost_timeline_block_init
  • eventscalendar_block_init
  • eventsmap_block_init
  • get_the_date_end
  • get_the_date_start
  • get_the_dates
  • get_the_location
  • the_date_end
  • the_date_start
  • the_dates
  • the_location
  • Overview
  • Namespace
  • Class
 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: 
<?php

namespace EventPost;
/*
* @package event-post
*/


class DashIcons{
  public $icons;
  public $icons_html_entities;
  public $transient_name;
  public $transient_name_html_entities;

  function __construct(){
    $this->icons = [];
    $this->icons_html_entities = [];
    $this->transient_name = "dashicons_list";
    $this->transient_name_html_entities = "dashicons_list_html_entities";
    add_action('init', array(&$this,'init_icons'));
  }
  function init_icons() {
    if(get_transient($this->transient_name) && get_transient($this->transient_name_html_entities)){
      $this->icons = get_transient($this->transient_name);
      $this->icons_html_entities = get_transient($this->transient_name_html_entities);
    }else{
      $css_file = file_get_contents(ABSPATH. 'wp-includes/css/dashicons.css');
      $css_array = explode('}',$css_file);
      foreach ($css_array as $rule) {
        $matches = [];
        if(preg_match(  "/\.dashicons-((?:\w+-?)+\w+):before {\s*content:\s*[\"\']\\\(\w+)[\"\'];/m",
                        $rule,
                        $matches))
        {
          if(isset($matches[1]) &&  isset($matches[2])){
            $this->icons[$matches[1]] = $matches[2];
            $this->icons_html_entities[$matches[1]] = '&#x'.$matches[2].'; '.$matches[1];
          }
        }
      }
      set_transient($this->transient_name , $this->icons, MONTH_IN_SECONDS );
      set_transient($this->transient_name_html_entities , $this->icons_html_entities, MONTH_IN_SECONDS );
    }
  }

}
API documentation generated by ApiGen