This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###### | |
# | |
# NOTE, you must reload your profile for these changes to take effect | |
# [your name ~] source .bash_profile | |
# color codes: http://www.funtoo.org/en/articles/linux/tips/prompt/ | |
# | |
###### | |
###### | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$_GLOBALS['task'] = new CustomPostType(); | |
$_GLOBALS['task']->post_type = array( | |
array( | |
'name' => 'Task', | |
'type' => 'task', | |
'supports' => array( | |
'title', | |
'editor', | |
'author', | |
'comments' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ICustomPostType { | |
public function registerPostType( $param=array() ); | |
public function registerTaxonomy( $param=array() ); | |
// @todo http://codex.wordpress.org/Function_Reference/locate_template | |
public function templateRedirect(); | |
public function regsiterActivation(); | |
// public function regsiterDeactivation(); | |
// public function baseStyleSheet( $param=array() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function registerPostType( $args=NULL ) { | |
foreach ( $this->post_type as $post_type ) { | |
if ( !empty( $post_type['taxonomies'] ) ) | |
$taxonomies = $post_type['taxonomies']; | |
. | |
. | |
. | |
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomPostType extends CustomPostTypeBase { | |
/** | |
* Every thing that is "custom" to our CPT goes here. | |
*/ | |
public function __construct() { | |
$this->dependencies['script'] = array( | |
'jquery', | |
'jquery-ui-core', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Zane M. Kolnik | |
email = zanematthew@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Build an option list of Terms based on a given Taxonomy. | |
* | |
* @package helper | |
* @uses zm_base_get_terms to return the terms with error checking | |
* @param string $taxonomy | |
* @param mixed $value, the value to be used in the form field, can be term_id or term_slug | |
*/ | |
if ( ! function_exists( 'zm_base_build_options' ) ) : | |
function zm_base_build_options( $taxonomy=null, $value=null ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function( $ ){ | |
$("a.toggle_handle").on( "click", function( event ){ | |
event.preventDefault | |
items = $( this ).attr("data-items"); | |
$( "tr." + items ).toggle(); | |
}); | |
$(".item_handle").on("click", function( event ){ | |
taxonomy = $(this).attr('data-taxonomy'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Sample data | |
$taxonomies = array( | |
'editorial' => array( | |
'book', | |
'magazines', | |
'new', | |
'newspaper', | |
'website', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adding a new field to the register form | |
* | |
* These are the steps needed to add a new field in ZM ALR (2.0.0+) | |
* They are as follows: | |
* 1. Add your field to the array of fields | |
* 2. Check the validation of your new field | |
* 3. Do something with the value AFTER successful registration |