From f9c5c62456b069af3c46619124c549beb0ff3665 Mon Sep 17 00:00:00 2001 From: "Toro_Unit (Hiroshi Urabe)" Date: Sat, 4 Feb 2017 06:39:14 +0900 Subject: [PATCH] set default in init --- CPTP/Module/Option.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CPTP/Module/Option.php b/CPTP/Module/Option.php index 6f6550c..8a2c4fe 100644 --- a/CPTP/Module/Option.php +++ b/CPTP/Module/Option.php @@ -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 ); } @@ -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 ); }