Skip to content

Instantly share code, notes, and snippets.

@taija
Last active August 29, 2015 14:24
Show Gist options
  • Save taija/5c4a68ed8c18f7482c7c to your computer and use it in GitHub Desktop.
Save taija/5c4a68ed8c18f7482c7c to your computer and use it in GitHub Desktop.
Clubs Plugin flush fix
function clubs_rewrite_flush() {
// First, we "add" the custom post type via the above written function.
// Note: "add" is written with quotes, as CPTs don't get added to the DB,
// They are only referenced in the post_type column with a post entry,
// when you add a post of this CPT.
// Both the custom post type and the custom taxonomy need to be called in this instance
create_club_post_type();
create_clubs_taxonomies();
// You should *NEVER EVER* do this on every page load!!
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'clubs_rewrite_flush' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment