Created
February 24, 2016 19:07
-
-
Save mariovalney/b61cbbd9457f26978e94 to your computer and use it in GitHub Desktop.
Alterar slug de um custom post type já registrado
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
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