for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* WebFont-Loader Module.
*
* @see https://github.com/typekit/webfontloader
* @package Kirki
* @category Modules
* @author Aristeides Stathopoulos
* @copyright Copyright (c) 2017, Aristeides Stathopoulos
* @license http://opensource.org/licenses/https://opensource.org/licenses/MIT
* @since 3.0.26
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
* Adds script for tooltips.
class Kirki_Modules_Webfont_Loader {
* The object instance.
* @static
* @access private
* @var object
private static $instance;
* Only load the webfont script if this is true.
* @access public
* @var bool
public static $load = false;
* The class constructor
* @access protected
protected function __construct() {
add_action( 'wp_head', array( $this, 'enqueue_scripts' ), 20 );
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
* @return object
public static function get_instance() {
if ( ! self::$instance ) {
self::$instance = new self();
return self::$instance;
* Enqueue scripts.
* @return void
public function enqueue_scripts() {
if ( self::$load ) {
wp_enqueue_script( 'webfont-loader', trailingslashit( Kirki::$url ) . 'modules/webfont-loader/vendor-typekit/webfontloader.js', array(), '3.0.28', true );