Skip to content

Instantly share code, notes, and snippets.

@khoipro
Last active February 7, 2022 07:33
Show Gist options
  • Select an option

  • Save khoipro/b7db1cc2b8d7c2beb7e793b64f4eeab3 to your computer and use it in GitHub Desktop.

Select an option

Save khoipro/b7db1cc2b8d7c2beb7e793b64f4eeab3 to your computer and use it in GitHub Desktop.
<?php
/**
* Register assets
*
* @package Example_Plugin
* @author codetot
* @since 0.0.1
*/
class Example_Assets {
/**
* Singleton instance
*
* @var Example_Assets
*/
private static $instance;
/**
* Get singleton instance.
*
* @return Example_Assets
*/
public final static function instance()
{
if (is_null(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
}
public function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'frontend_assets' ) );
}
/**
* Enqueue frontend assets
*
* @return void
*/
public function frontend_assets() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment