WordPress 4.5 introduced the functions unregister_post_type() and unregister_taxonomy(). You could deregister your post type respectively taxonomy and register them again with your custom settings. The post type is still named portfolio
. You could rename it, but you would probably have to check your template files for references.
add_action('init', 'wpse_247924_overwrite_theme_post_types', 1000);
function wpse_247924_overwrite_theme_post_types() {
unregister_post_type( 'portfolio' );
$labels = array(
'name' => __( 'Portfolio', 'read' ),
'singular_name' => __( 'Portfolio Item', 'read' ),
'add_new' => __( 'Add New', 'read' ),
'add_new_item' => __( 'Add New', 'read' ),
'edit_item' => __( 'Edit', 'read' ),
'new_item' => __( 'New', 'read' ),
'all_items' => __( 'All', 'read' ),
'view_item' => __( 'View', 'read' ),
'search_items' => __( 'Search', 'read' ),
'not_found' => __( 'No Items found', 'read' ),
'not_found_in_trash' => __( 'No Items found in Trash', 'read' ),
'parent_item_colon' => '',
'menu_name' => 'Portfolio'
);
$args = array(
'labels' => $labels,
'public' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'show_in_nav_menus' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => 5,
'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions' ),
'rewrite' => array(
'slug' => 'conteudo',
'with_front' => false
)
);
register_post_type( 'portfolio' , $args );
unregister_taxonomy( 'department' );
$labels_dep = array(
'name' => __( 'Departments', 'read' ),
'singular_name' => __( 'Department', 'read' ),
'search_items' => __( 'Search', 'read' ),
'all_items' => __( 'All', 'read' ),
'parent_item' => __( 'Parent Department', 'read' ),
'parent_item_colon' => __( 'Parent Department:', 'read' ),
'edit_item' => __( 'Edit', 'read' ),
'update_item' => __( 'Update', 'read' ),
'add_new_item' => __( 'Add New', 'read' ),
'new_item_name' => __( 'New Department Name', 'read' ),
'menu_name' => __( 'Departments', 'read' )
);
register_taxonomy(
'material',
array( 'portfolio' ),
array(
'hierarchical' => true,
'labels' => $labels_dep,
'show_ui' => true,
'public' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'material'
)
)
);
$labels_tag = array(
'name' => __( 'Portfolio Tags', 'read' ),
'singular_name' => __( 'Portfolio Tag', 'read' ),
'search_items' => __( 'Search', 'read' ),
'all_items' => __( 'All', 'read' ),
'parent_item' => __( 'Parent Portfolio Tag', 'read' ),
'parent_item_colon' => __( 'Parent Portfolio Tag:', 'read' ),
'edit_item' => __( 'Edit', 'read' ),
'update_item' => __( 'Update', 'read' ),
'add_new_item' => __( 'Add New', 'read' ),
'new_item_name' => __( 'New Portfolio Tag Name', 'read' ),
'menu_name' => __( 'Portfolio Tags', 'read' )
);
register_taxonomy(
'portfolio_tags',
array( 'portfolio' ),
array(
'hierarchical' => false,
'labels' => $labels_tag,
'show_ui' => true,
'public' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'portfolio_tags'
)
)
);
}