Skip to content

Instantly share code, notes, and snippets.

@dhbit
Created October 10, 2021 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhbit/100be66896d4016ebb659306fb1b9b54 to your computer and use it in GitHub Desktop.
Save dhbit/100be66896d4016ebb659306fb1b9b54 to your computer and use it in GitHub Desktop.
EventEspresso Invoice Style
<?php
namespace Academy\Core\Hooks\Filters;
use Academy\Core\Hooks\Filters;
class EventEspressoInvoiceStyle extends Filters
{
public function __construct()
{
parent::__construct('FHEE__EE_Messages_Template_Pack__get_variation', 10, 8);
}
public function callback($cssFile)
{
$newCss = get_stylesheet_directory_uri().'/assets/css/'.strtolower(PLUGIN_PREFIX).'_invoices.css';
return $newCss;
}
}
<?php
namespace Academy\Core\Hooks;
class Filters
{
private $hookName = '';
public function __construct($hookName)
{
$this->hookName = $hookName;
$this->register();
}
public function register()
{
add_filter($this->hookName, [$this, 'callback'], 10, 3);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment