/** * Returns the instance. * * @since 1.2.0 * @return object */ public static function get_instance($handler_file = null) { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self($handler_file); } return self::$instance; }
/** * Initalize CSS collector class * * @since 1.2.0 * @return bool */ public function init_collector() { if (null !== self::$collector) { return true; } require_once 'inc/class-cherry-dynamic-css-collector.php'; ob_start(); include 'assets/min/cherry-css-collector.min.js'; $handler = ob_get_clean(); self::$collector = Cherry_Dynamic_Css_Collector::get_instance($handler); add_action('wp_footer', array(self::$collector, 'print_style'), 11); add_action('wp_footer', array(self::$collector, 'add_js_handler'), 11); return true; }