Skip to content

Instantly share code, notes, and snippets.

@smileBeda
Created December 9, 2020 12:32
Show Gist options
  • Save smileBeda/b6c4e649ed9379f9d660ee04098a813d to your computer and use it in GitHub Desktop.
Save smileBeda/b6c4e649ed9379f9d660ee04098a813d to your computer and use it in GitHub Desktop.
add_filter( 'register_post_type_args', 'rename_registered_post_types', 999, 2 );
function rename_registered_post_types( $args, $post_type ){
if( 'post' == $post_type ){//your post type to rename
$args['rewrite']['slug'] = 'your_custom_slug';
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment