2018-08-23 02:07:06 +00:00
|
|
|
<?php
|
|
|
|
namespace init;
|
|
|
|
|
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/api.php';
|
2018-09-03 16:47:08 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/actors.php';
|
2018-09-19 18:01:27 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/migrations.php';
|
2018-08-23 02:07:06 +00:00
|
|
|
|
|
|
|
add_action( 'rest_api_init', function() {
|
|
|
|
\api\register_routes();
|
|
|
|
} );
|
|
|
|
|
2018-09-04 01:22:23 +00:00
|
|
|
add_action( 'user_register', function( $user_id ) {
|
|
|
|
$slug = get_the_author_meta( 'user_nicename', $user_id );
|
|
|
|
\actors\create_actor_from_user( $slug );
|
|
|
|
} );
|
|
|
|
|
2018-09-19 15:16:41 +00:00
|
|
|
add_action( 'pterotype_init', function() {
|
2018-09-04 01:22:23 +00:00
|
|
|
\actors\initialize_user_actors();
|
2018-08-23 02:07:06 +00:00
|
|
|
} );
|
2018-09-19 21:44:21 +00:00
|
|
|
|
|
|
|
add_action( 'pterotype_load', function() {
|
|
|
|
\migrations\run_migrations();
|
|
|
|
} );
|
2018-08-23 02:07:06 +00:00
|
|
|
?>
|