Run migrations on every load

This commit is contained in:
Jeremy Dormitzer 2018-09-19 17:44:21 -04:00
parent 9c1260c9d0
commit d115480f47
2 changed files with 6 additions and 2 deletions

View File

@ -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();
} );
?>

View File

@ -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');
?>