Skip to content

Instantly share code, notes, and snippets.

@Anna-Myzukina
Created August 22, 2018 08:12
Show Gist options
  • Save Anna-Myzukina/2ee27ba546527b71a642bbcfaf809c13 to your computer and use it in GitHub Desktop.
Save Anna-Myzukina/2ee27ba546527b71a642bbcfaf809c13 to your computer and use it in GitHub Desktop.
mu-plugins
<?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