Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save devnepsys/b72b8d0bc0cd9e70b726c22fc09b6d11 to your computer and use it in GitHub Desktop.
Save devnepsys/b72b8d0bc0cd9e70b726c22fc09b6d11 to your computer and use it in GitHub Desktop.

Revisions

  1. @brianleejackson brianleejackson revised this gist May 29, 2020. No changes.
  2. @brianleejackson brianleejackson created this gist May 29, 2020.
    8 changes: 8 additions & 0 deletions remove-slug-cpt-alternate.php
    Original 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);