Created
April 13, 2020 16:09
-
-
Save siddjain/056cf364318f82f350bd49d48a4c797b to your computer and use it in GitHub Desktop.
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
function my_custom_post_product() { | |
$labels = array( | |
'name' => _x( 'Articles', 'post type general name' ), | |
'singular_name' => _x( 'Article', 'post type singular name' ), | |
'add_new' => _x( 'Add New', 'article' ), | |
'add_new_item' => __( 'Add New Article' ), | |
'edit_item' => __( 'Edit Article' ), | |
'new_item' => __( 'New Article' ), | |
'all_items' => __( 'All Articles' ), | |
'view_item' => __( 'View Article' ), | |
'search_items' => __( 'Search Articles' ), | |
'not_found' => __( 'No articles found' ), | |
'not_found_in_trash' => __( 'No articles found in the Trash' ), | |
'menu_name' => 'Articles' | |
); | |
$args = array( | |
'labels' => $labels, | |
'description' => 'Article submitted to Data Science Showcase', | |
'public' => true, | |
'menu_position' => 5, | |
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ), | |
'has_archive' => true, | |
); | |
my_log_file('registering custom post type'); | |
register_post_type( 'article', $args ); | |
} | |
add_action( 'init', 'article\my_custom_post_product' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment