dgmike
10/2/2012 - 2:12 AM

WordPress Taxonomy Snippet for Sublime Text

WordPress Taxonomy Snippet for Sublime Text

<snippet>
	<content><![CDATA[

// Create taxonomy
add_action( 'init', 'create_${1:FUNCTION}' );
function create_${1:FUNCTION}() {
 $labels = array(
    'name' => _x( '${3:PLURAL}', 'taxonomy general name' ),
    'singular_name' => _x( '${2:SINGULAR}', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search ${3:PLURAL}' ),
    'all_items' => __( 'All ${3:PLURAL}' ),
    'parent_item' => __( 'Parent ${2:SINGULAR}' ),
    'parent_item_colon' => __( 'Parent ${2:SINGULAR}:' ),
    'edit_item' => __( 'Edit ${2:SINGULAR}' ),
    'update_item' => __( 'Update ${2:SINGULAR}' ),
    'add_new_item' => __( 'Add New ${2:SINGULAR}' ),
    'new_item_name' => __( 'New ${2:SINGULAR} Name' ),
  ); 	

  register_taxonomy('${3:PLURAL}','${4:POST-TYPE}',array(
    'hierarchical' => true, // false for tags
    'labels' => $labels
  ));
}

]]></content>
	<tabTrigger>wptax</tabTrigger>
	<scope>source.php</scope>
</snippet>