0
X
Add Snippet To Project
New Project
Add To Existing Project
/**
* Registers a custom post type 'fun_facts'.
*
* @since 1.0.0
*
* @return void
*/
function nagytravel_register_my_custom_post_type() : void {
$labels = [
'name' => _x( 'Fun factss', 'Post Type General Name', 'nagytravel' ),
'singular_name' => _x( 'Fun facts', 'Post Type Singular Name', 'nagytravel' ),
'menu_name' => __( 'Fun factss', 'nagytravel' ),
'name_admin_bar' => __( 'Fun factss', 'nagytravel' ),
'archives' => __( 'Fun factss Archives', 'nagytravel' ),
'attributes' => __( 'Fun factss Attributes', 'nagytravel' ),
'parent_item_colon' => __( 'Parent Fun facts:', 'nagytravel' ),
'all_items' => __( 'All Fun factss', 'nagytravel' ),
'add_new_item' => __( 'Add New Fun facts', 'nagytravel' ),
'add_new' => __( 'Add New', 'nagytravel' ),
'new_item' => __( 'New Fun facts', 'nagytravel' ),
'edit_item' => __( 'Edit Fun facts', 'nagytravel' ),
'update_item' => __( 'Update Fun facts', 'nagytravel' ),
'view_item' => __( 'View Fun facts', 'nagytravel' ),
'view_items' => __( 'View Fun factss', 'nagytravel' ),
'search_items' => __( 'Search Fun factss', 'nagytravel' ),
'not_found' => __( 'Fun facts Not Found', 'nagytravel' ),
'not_found_in_trash' => __( 'Fun facts Not Found in Trash', 'nagytravel' ),
'featured_image' => __( 'Featured Image', 'nagytravel' ),
'set_featured_image' => __( 'Set Featured Image', 'nagytravel' ),
'remove_featured_image' => __( 'Remove Featured Image', 'nagytravel' ),
'use_featured_image' => __( 'Use as Featured Image', 'nagytravel' ),
'insert_into_item' => __( 'Insert into Fun facts', 'nagytravel' ),
'uploaded_to_this_item' => __( 'Uploaded to this Fun facts', 'nagytravel' ),
'items_list' => __( 'Fun factss List', 'nagytravel' ),
'items_list_navigation' => __( 'Fun factss List Navigation', 'nagytravel' ),
'filter_items_list' => __( 'Filter Fun factss List', 'nagytravel' ),
];
$labels = apply_filters( 'fun_facts-labels', $labels );
$args = [
'label' => __( 'Fun facts', 'nagytravel' ),
'description' => __( 'Fun facts about traveling', 'nagytravel' ),
'labels' => $labels,
'supports' => [
'title',
'editor',
'excerpt',
'author',
'thumbnail',
'comments',
'trackbacks',
'custom-fields',
],
'taxonomies' => [
'categories',
],
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-buddicons-activity',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'query_var' => 'fun_facts',
'exclude_from_search' => false,
'has_archive' => 'fun_facts_archive',
'can_export' => false,
'rewrite' => [
'slug' => 'fun_facts',
'with_front' => true,
'pages' => true,
'feeds' => false,
],
'capability_type' => 'post',
'show_in_rest' => true,
];
$args = apply_filters( 'fun_facts-args', $args );
register_post_type( 'fun_facts', $args );
}
add_action( 'init', 'nagytravel_register_my_custom_post_type', 0 );