Skip to content

Instantly share code, notes, and snippets.

@austinjreilly
Last active August 29, 2015 14:00
Show Gist options
  • Save austinjreilly/11050030 to your computer and use it in GitHub Desktop.
Save austinjreilly/11050030 to your computer and use it in GitHub Desktop.
Gets rewrite slug for custom post type.
$postTypeObject = get_post_type_object( $postType );
$rewriteSlug = $postTypeObject->rewrite['slug'];
$linkPrefix = home_url() . '/' . $rewriteSlug . '/';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment