You are here

public static function ShareaholicUtilities::load_template in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 utilities.php \ShareaholicUtilities::load_template()

Locate and require a template, and extract some variables to be used in that template.

Parameters

string $template the name of the template:

array $vars any variables to be extracted into the template:

3 calls to ShareaholicUtilities::load_template()
ShareaholicAdmin::include_snapengage in ./admin.php
Renders SnapEngage
ShareaholicAdmin::show_footer in ./admin.php
Renders footer
ShareaholicAdmin::show_header in ./admin.php

File

./utilities.php, line 809

Class

ShareaholicUtilities

Code

public static function load_template($template, $vars = array()) {

  // you cannot let locate_template to load your template
  // because WP devs made sure you can't pass
  // variables to your template :(
  $template_path = SHAREAHOLIC_DIR . '/templates/' . $template . '.php';

  // load it
  extract($vars);
  require $template_path;
}