Skip to content

Commit

Permalink
set default in init
Browse files Browse the repository at this point in the history
  • Loading branch information
torounit committed Feb 3, 2017
1 parent 01dbb11 commit f9c5c62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CPTP/Module/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class CPTP_Module_Option extends CPTP_Module {

public function add_hook() {
add_action( 'shutdown', array( $this, 'set_default_option' ), 1 );
add_action( 'init', array( $this, 'set_default_option' ), 1 );
add_action( 'admin_init', array( $this, 'save_options' ), 30 );
}

Expand Down Expand Up @@ -67,7 +67,7 @@ public function save_options() {
update_option( $post_type . '_structure', $structure );
endforeach;

update_option( 'no_taxonomy_structure', ! isset( $_POST['no_taxonomy_structure'] ) );
update_option( 'no_taxonomy_structure', empty( $_POST['no_taxonomy_structure'] ) );
update_option( 'add_post_type_for_tax', isset( $_POST['add_post_type_for_tax'] ) );
update_option( 'cptp_permalink_checked', CPTP_VERSION );
}
Expand Down

0 comments on commit f9c5c62

Please sign in to comment.