Last active
November 15, 2019 08:15
-
-
Save wadadanet/a18a225bf3e7a8a43f21f04aa0590720 to your computer and use it in GitHub Desktop.
Wordpress CPT 新着情報
This file contains 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 cptui_register_my_cpts_news() { | |
/** | |
* Post Type: 新着情報. | |
*/ | |
$labels = [ | |
"name" => __( "新着情報", "twentytwenty" ), | |
"singular_name" => __( "新着情報", "twentytwenty" ), | |
]; | |
$args = [ | |
"label" => __( "新着情報", "twentytwenty" ), | |
"labels" => $labels, | |
"description" => "", | |
"public" => true, | |
"publicly_queryable" => true, | |
"show_ui" => true, | |
"delete_with_user" => false, | |
"show_in_rest" => true, | |
"rest_base" => "", | |
"rest_controller_class" => "WP_REST_Posts_Controller", | |
"has_archive" => true, | |
"show_in_menu" => true, | |
"show_in_nav_menus" => true, | |
"delete_with_user" => false, | |
"exclude_from_search" => false, | |
"capability_type" => "post", | |
"map_meta_cap" => true, | |
"hierarchical" => false, | |
"rewrite" => [ "slug" => "news", "with_front" => true ], | |
"query_var" => true, | |
"menu_icon" => "dashicons-megaphone", | |
"supports" => [ "title", "editor" ], | |
]; | |
register_post_type( "news", $args ); | |
} | |
add_action( 'init', 'cptui_register_my_cpts_news' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment