Sha256: 545e3f1ec301201b092ea9ba1a6d3e127382fdae867168d3955e943ce708f340

Contents?: true

Size: 1013 Bytes

Versions: 6

Compression:

Stored size: 1013 Bytes

Contents

<?php
include "inflector.php";
include "cpt.php";

// If Timber not installed, ignore all the code below this
if (!class_exists("Timber") ) {
  return;
}

class TimberEdge extends TimberSite {

  function __construct(){
    add_filter("timber_context", array($this, "add_to_context") );
    add_filter("get_twig", array($this, "add_to_twig") );
    parent::__construct();
  }

  function add_to_context($context) {
    $context["menu"] = new TimberMenu();
    $context["site"] = $this;

    $context["home"] = home_url()."/";
    $context["root"] = get_template_directory_uri();
    $context["img"] = $context["root"]."/assets/img";
    $context["css"] = $context["root"]."/assets/css";
    $context["js"] = $context["root"]."/assets/js";
    $context["files"] = $context["root"]."/assets/files";
    
    return $context;
  }

  function add_to_twig($twig) {
    return $twig;
  }
}

new TimberEdge();

/* REMOVE MENU ITEMS */
add_action("admin_menu", "remove_menu_items");

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
edge_framework-2.0.0.a template/wordpress/code/main.php
edge_framework-1.4.1 template/wordpress/code/main.php
edge_framework-1.4.0 template/wordpress/code/main.php
edge_framework-1.3.6 template/wordpress/code/main.php
edge_framework-1.3.5 template/wordpress/code/main.php
edge_framework-1.3.3 template/wordpress/code/main.php