Skip to content

Instantly share code, notes, and snippets.

@pelmered
Last active January 4, 2016 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pelmered/d8580564d5fd6b00a6a4 to your computer and use it in GitHub Desktop.
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
<?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