Forked from brianleejackson/remove-slug-cpt-alternate.php
Created
November 14, 2021 10:52
-
-
Save devnepsys/b72b8d0bc0cd9e70b726c22fc09b6d11 to your computer and use it in GitHub Desktop.
Revisions
-
brianleejackson revised this gist
May 29, 2020 . No changes.There are no files selected for viewing
-
brianleejackson created this gist
May 29, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ function bis_remove_cpt_slug($args, $post_type) { if(in_array($post_type, array('artist'))) { $args['rewrite'] = array('slug' => '/'); } return $args; } add_filter('register_post_type_args', 'bis_remove_cpt_slug', 10, 2);