Skip to content

Instantly share code, notes, and snippets.

View icreatesolutions's full-sized avatar

icreatesolutions

View GitHub Profile
@webaware
webaware / plugin-template-functions.php
Created February 17, 2018 02:21
I have these functions in the plugin class that accesses templates, or break them out into simple functions if I'm using a namespace
<?php
/**
* load template from theme or plugin
* @param string $template name of template to load
* @param array $templateData data to make available to templates
*/
public function loadTemplate($template, $templateData = []) {
extract($templateData);