Last active
January 4, 2016 16:49
-
-
Save pelmered/d8580564d5fd6b00a6a4 to your computer and use it in GitHub Desktop.
Create taxonomy with rewrite with Post types creator https://github.com/pelmered/post-types-creator
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
<?php | |
if( class_exists( 'PE_Post_Type_Creator' ) ) | |
{ | |
$ptc = new PE_Post_Type_Creator(); | |
$text_domain = 'text-domain'; | |
$ptc->set_taxonomies(array( | |
'min-taxonomi' => array( | |
'singular_label' => _x('Min taxonomi', 'Post type plural', $text_domain), | |
'plural_label' => _x('Mina taxonomier', 'Post type singular', $text_domain), | |
'description' => _x('beskrivning', 'Post type description', $text_domain), | |
'post_type' => 'product', | |
// Override any defaults in register_taxonomy() | |
// http://codex.wordpress.org/Function_Reference/register_taxonomy | |
'rewrite' => array( | |
'slug' => '/shop/min-taxonomi', | |
'with_front' => false | |
), | |
), | |
'min-taxonomi-2' => array( | |
'singular_label' => _x('Min andra taxonomi', 'Post type plural', $text_domain), | |
'plural_label' => _x('Mina andra taxonomier', 'Post type singular', $text_domain), | |
'description' => _x('beskrivning', 'Post type description', $text_domain), | |
'post_type' => 'product', | |
// Override any defaults in register_taxonomy() | |
// http://codex.wordpress.org/Function_Reference/register_taxonomy | |
'rewrite' => array( | |
'slug' => '/shop/min-taxonomi2', | |
'with_front' => false | |
), | |
), | |
)); | |
add_action( 'init', array($ptc, 'init'), 0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment