Skip to content

Instantly share code, notes, and snippets.

@mattonomics
Created October 9, 2012 21:38
Show Gist options
  • Save mattonomics/3861622 to your computer and use it in GitHub Desktop.
Save mattonomics/3861622 to your computer and use it in GitHub Desktop.
Adding a skin specific box to the boxes queue
<?php
class example_skin_class extends thesis_skin {
// list of box classes you want to add to the queue
// do not give these strings for keys or everything will blow up
public $boxes_class_list = array(
'box_class_one',
'box_class_two',
'box_class_three',
'box_class_four',
);
// pseudo constructor function. use this over __construct() or you risk and explosion ;)
function construct() {
// filter that contains all the boxes
add_filter('thesis_boxes', array($this, 'add_boxes'));
}
function add_boxes($boxes) {
// require the box file, presumably box.php and packaged in the skin
require_once(dirname(__FILE__) . '/box.php');
// merge the main box array with yours.
return array_merge($boxes, $this->boxes_class_list);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment