Skip to content

Instantly share code, notes, and snippets.

@mariovalney
Created February 24, 2016 19:07
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 mariovalney/b61cbbd9457f26978e94 to your computer and use it in GitHub Desktop.
Save mariovalney/b61cbbd9457f26978e94 to your computer and use it in GitHub Desktop.
Alterar slug de um custom post type já registrado
function change_post_type_slug() {
$post_type_portfolio_object = get_post_type_object( 'portfolio' );
$post_type_portfolio_object->rewrite['slug'] = 'produto';
register_post_type( $post_type_object->name, $post_type_object );
}
add_action( 'init', 'change_post_type_slug', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment