diff --git a/inc/init.php b/inc/init.php index b78dc34..70e1e81 100644 --- a/inc/init.php +++ b/inc/init.php @@ -15,7 +15,10 @@ add_action( 'user_register', function( $user_id ) { } ); add_action( 'pterotype_init', function() { - \migrations\run_migrations(); \actors\initialize_user_actors(); } ); + +add_action( 'pterotype_load', function() { + \migrations\run_migrations(); +} ); ?> diff --git a/pterotype.php b/pterotype.php index b0b9e87..93a10f1 100644 --- a/pterotype.php +++ b/pterotype.php @@ -7,9 +7,10 @@ require_once plugin_dir_path( __FILE__ ) . 'inc/init.php'; define( 'PTEROTYPE_VERSION', '0.0.1' ); function pterotype_init() { - update_option( 'pterotype_version', PTEROTYPE_VERSION ); do_action( 'pterotype_init' ); } +do_action( 'pterotype_load' ); + register_activation_hook( __FILE__, 'pterotype_init'); ?>