Contact Post Type
// Register Custom Post Type
function custom_post_type_contact() {
$labels = array(
'name' => _x( 'Contacts', 'Post Type General Name', 'izanagi' ),
'singular_name' => _x( 'Contact', 'Post Type Singular Name', 'izanagi' ),
'menu_name' => __( 'Contacts', 'izanagi' ),
'parent_item_colon' => __( 'Contact Company:', 'izanagi' ),
'all_items' => __( 'All Contacts', 'izanagi' ),
'view_item' => __( 'View Contact', 'izanagi' ),
'add_new_item' => __( 'Add New Contact', 'izanagi' ),
'add_new' => __( 'Add New', 'izanagi' ),
'edit_item' => __( 'Edit Contact', 'izanagi' ),
'update_item' => __( 'Update Contact', 'izanagi' ),
'search_items' => __( 'Search Contact', 'izanagi' ),
'not_found' => __( 'Not found', 'izanagi' ),
'not_found_in_trash' => __( 'Not found in Trash', 'izanagi' ),
);
$capabilities = array(
'edit_post' => 'edit_contact',
'read_post' => 'read_contact',
'delete_post' => 'delete_contact',
'edit_posts' => 'edit_contacts',
'edit_others_posts' => 'edit_others_contacts',
'publish_posts' => 'publish_contacts',
'read_private_posts' => 'read_private_contacts',
);
$args = array(
'label' => __( 'contact', 'izanagi' ),
'description' => __( 'Company or Person Contact', 'izanagi' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'comments', ),
'taxonomies' => array( 'contact_types' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capabilities' => $capabilities,
);
register_post_type( 'contact', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_post_type_contact', 0 );