Skip to content

Instantly share code, notes, and snippets.

@ironprogrammer
Last active November 11, 2023 02:21
Show Gist options
  • Save ironprogrammer/24fbeedc186e7e85a45711932bf94b8a to your computer and use it in GitHub Desktop.
Save ironprogrammer/24fbeedc186e7e85a45711932bf94b8a to your computer and use it in GitHub Desktop.
Test for Trac 58361
<?php
function custom_post_type_books() {
$labels = array(
'name' => _x( 'Books', 'post type general name', 'your-text-domain' ),
'singular_name' => _x( 'Book', 'post type singular name', 'your-text-domain' ),
'menu_name' => _x( 'Books', 'admin menu', 'your-text-domain' ),
);
$args = array(
'labels' => $labels,
'show_ui' => true,
'show_in_menu' => true,
'menu_icon' => 'none', // Set to 'none' to use CSS for the icon
);
register_post_type( 'books', $args );
}
add_action( 'init', 'custom_post_type_books' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment