Created
August 22, 2018 08:12
-
-
Save Anna-Myzukina/2ee27ba546527b71a642bbcfaf809c13 to your computer and use it in GitHub Desktop.
mu-plugins
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: To add post type | |
* Plugin URI: http://# | |
* Description: This is custom plugin to add taxonomy po post type. | |
* Author: Muzykina Ann | |
* Author URI: http://# | |
* Version: 0.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