public
Created

  • Download Gist
whatever.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<?php
function vtp_install_data() {
add_action( 'init', 'vtp_setup_terms', 11 );
}
 
register_activation_hook( __FILE__, 'vtp_install_data' );
 
function vtp_setup_terms() {
if ( ! term_exists( 'Customer', 'account_type' ) ) {
wp_insert_term( 'Customer', 'account_type');
}
}
 
add_action( 'init', 'register_taxonomy_account_type' );
 
function register_taxonomy_account_type() {
 
$labels = array(
'name' => _x( 'Account Types', 'account type' ),
'singular_name' => _x( 'Account Type', 'account type' ),
'search_items' => _x( 'Search Account Types', 'account type' ),
'popular_items' => _x( 'Popular Account Types', 'account type' ),
'all_items' => _x( 'All Account Types', 'account type' ),
'parent_item' => _x( 'Parent Account Type', 'account type' ),
'parent_item_colon' => _x( 'Parent Account Type:', 'account type' ),
'edit_item' => _x( 'Edit Account Type', 'account type' ),
'update_item' => _x( 'Update Account Type', 'account type' ),
'add_new_item' => _x( 'Add New Account Type', 'account type' ),
'new_item_name' => _x( 'New Account Type Name', 'account type' ),
'separate_items_with_commas' => _x( 'Separate account types with commas', 'account type' ),
'add_or_remove_items' => _x( 'Add or remove account types', 'account type' ),
'choose_from_most_used' => _x( 'Choose from the most used account types', 'account type' ),
'menu_name' => _x( 'Account Types', 'account type' ),
);
 
$args = array(
'labels' => $labels,
'public' => true,
'show_in_nav_menus' => true,
'show_ui' => true,
'show_tagcloud' => false,
'hierarchical' => true,
 
'rewrite' => true,
'query_var' => true
);
 
register_taxonomy( 'account_type', array('Accounts'), $args );
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.