Skip to content

Instantly share code, notes, and snippets.

@themefoundation
themefoundation / using-input-class-demo.php
Created January 9, 2013 18:56
Using the form input class.
<?php
/**
* Displays metabox content
*
* Displays metabox content based on the metabox array, usually set in the
* theme's functions.php file.
*
* @since 1.0
* @param array $post The current post object.
@themefoundation
themefoundation / input-class-demo.php
Last active October 12, 2015 09:07
Input Class Demo
<?php
class THTK_Form_Input {
// Sets default form element properties
public $defaults = array(
'id' => '', // Unique ID for this option
'class' => '', // Optional CSS classes for input
'title' => '', // The content to display as the input title/label
'value' => '', // The option value
@themefoundation
themefoundation / thtk-metabox-array.php
Created November 1, 2012 23:28
Metabox array for creating metaboxes with the theme toolkit
/**
* Defines metabox arrays
*/
function thtk_example_metaboxes() {
// Defines $prefix. Should begin with an underscore unless you want fields to be doubled in the Custom Fields editor.
$prefix = '_example_';
// Defines metabox array.
$meta_boxes[] = array(
@themefoundation
themefoundation / thtk-get-metabox-array.php
Created November 1, 2012 23:18
Funtion for passing an array from a WP theme to the Theme Toolkit
/**
* Gets the metaboxes array from the theme
*
* Provides a filter that is used by the theme to pass the metabox details
* array to the Theme Toolkit for processing.
*
* @since 1.0
* @param array $thtk_metaboxes Array of metaboxes (empty by default).
* @return array Metaboxes array, usually defined in the theme's functions.php file.
*/