Created
August 22, 2018 08:13
-
-
Save Anna-Myzukina/370a17ef8ba9b270b3c5bae66cc91282 to your computer and use it in GitHub Desktop.
add-posttype
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 | |
/** | |
* Plugin Name: Add taxonomy post type | |
* Description: Easy add new taxonomy to your post type | |
* Plugin URL: http://# | |
* Author: Musykuna Ann | |
* Author http://# | |
* Version: 1.0 | |
*/ | |
function create_taxonomy_to_cars() { | |
register_post_type( 'car', | |
array( | |
'labels' => array( | |
'name' => __( 'Cars' ), | |
'singular_name' => __( 'Car' ) | |
), | |
'menu_position' => 5, | |
'supports' => array('title','editor','post-formats','except','thumbnail'), | |
'public' => true, | |
'has_archive' => true, | |
) | |
); | |
register_taxonomy( | |
'moduls', | |
'car', | |
array( | |
'label' => __( 'Moduls' ), | |
'rewrite' => array( 'slug' => 'person' ), | |
) | |
); | |
} | |
add_action( 'init', 'create_taxonomy_to_cars' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment