Skip to content

Instantly share code, notes, and snippets.

@claudioweb
Last active July 4, 2017 17:46
Show Gist options
  • Save claudioweb/2cafcbb1db448c725e36df5248a5101d to your computer and use it in GitHub Desktop.
Save claudioweb/2cafcbb1db448c725e36df5248a5101d to your computer and use it in GitHub Desktop.
Taxonomy exemplo para modelos
<?php
function modelos() {
$labels = array(
'name' => 'Modelos',
'singular_name' => 'Modelo'
);
$args = array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'modelos' ),
'exclude_from_search' => false,
'publicly_queryable' => true,
'public' => true,
);
register_taxonomy( 'modelos', 'produtos', $args );
}
add_action( 'init', 'modelos' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment