Skip to content

Commit

Permalink
Flush rewrite rules on permalink change
Browse files Browse the repository at this point in the history
  • Loading branch information
simultech committed Sep 19, 2016
1 parent 00b7e2a commit 928b702
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shorthand_connect/includes/shorthand_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ function shorthand_options() {
}
if( isset($_POST['sh_submit_hidden_three']) && $_POST['sh_submit_hidden_three'] == 'Y' ) {
update_option('sh_permalink', $_POST['sh_permalink']);
create_post_type();
flush_rewrite_rules();
}
$permalink_structure = get_option('sh_permalink');

Expand Down
6 changes: 6 additions & 0 deletions shorthand_connect/shorthand_connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,5 +317,11 @@ function shorthand_show_columns($name) {
}
add_action('manage_posts_custom_column', 'shorthand_show_columns');

function myplugin_activate() {
create_post_type();
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'myplugin_activate' );


?>

0 comments on commit 928b702

Please # to comment.