Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bracketpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,17 @@ function activate() {
$this->update_option('edit_id', wp_insert_post($post));
}

// The init hook does not run during plugin activation, so register the
// custom post type before flushing rewrites. Otherwise WordPress flushes
// rules without the bracket permalink structure and bracket links can 404
// until the site owner manually saves permalinks.
$this->register_posts();
flush_rewrite_rules();
}

function deactivate() { }
function deactivate() {
flush_rewrite_rules();
}


function register_posts() {
Expand Down