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
11 changes: 9 additions & 2 deletions wpap-publication.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ function wpap_create_publication() {
'rewrite' => true));
register_taxonomy_for_object_type('publication-category', 'publication');

flush_rewrite_rules();
}

// Flush rewrite on plugin activation
function wpap_flush_rewrites() {
// call your CPT registration function here (it should also be hooked into 'init')
wpsap_create_publication();
// flush the rules
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'wpap_flush_rewrites' );

// add table column in edit page
function wpap_show_publication_column ($columns) {
Expand Down Expand Up @@ -312,4 +319,4 @@ function wpap_get_publications_formatted ($options = array()) {
return wpap_get_pubs_formatted($all_options);
}

?>
?>