Created
March 26, 2022 13:18
-
-
Save duplaja/2233e6149892436a3a7976b103ee9c36 to your computer and use it in GitHub Desktop.
WordPress Equipment Post Type
This file contains hidden or 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 | |
if ( ! function_exists('register_equpiment_post_type') ) { | |
// Register Custom Post Type | |
function register_equpiment_post_type() { | |
$labels = array( | |
'name' => 'Equipment', | |
'singular_name' => 'Equpiment', | |
'menu_name' => 'Equpiment', | |
'name_admin_bar' => 'Equpiment', | |
'archives' => 'Equipment Archives', | |
'attributes' => 'Equipment Attributes', | |
'parent_item_colon' => 'Parent Equipment:', | |
'all_items' => 'All Equipment', | |
'add_new_item' => 'Add New Equipment', | |
'add_new' => 'Add New', | |
'new_item' => 'New Equipment', | |
'edit_item' => 'Edit Equipment', | |
'update_item' => 'Update Equipment', | |
'view_item' => 'View Equipment', | |
'view_items' => 'View Equipment', | |
'search_items' => 'Search Equipment', | |
'not_found' => 'Not found', | |
'not_found_in_trash' => 'Not found in Trash', | |
'featured_image' => 'Featured Image', | |
'set_featured_image' => 'Set equipment image', | |
'remove_featured_image' => 'Remove equipment image', | |
'use_featured_image' => 'Use as equipment image', | |
'insert_into_item' => 'Insert into equipment', | |
'uploaded_to_this_item' => 'Uploaded to this equpiment', | |
'items_list' => 'Equipment list', | |
'items_list_navigation' => 'Equipment list navigation', | |
'filter_items_list' => 'Filter equipment list', | |
); | |
$args = array( | |
'label' => 'Equpiment', | |
'description' => 'Item currently owned.', | |
'labels' => $labels, | |
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields' ), | |
'taxonomies' => array( 'category', 'post_tag' ), | |
'hierarchical' => false, | |
'public' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'menu_position' => 5, | |
'menu_icon' => 'dashicons-hammer', | |
'show_in_admin_bar' => true, | |
'show_in_nav_menus' => true, | |
'can_export' => true, | |
'has_archive' => true, | |
'exclude_from_search' => false, | |
'publicly_queryable' => true, | |
'capability_type' => 'page', | |
'show_in_rest' => true, | |
); | |
register_post_type( 'equpiment', $args ); | |
} | |
add_action( 'init', 'register_equpiment_post_type', 0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment