pterotype/inc/init.php

22 lines
547 B
PHP
Raw Normal View History

<?php
namespace init;
require_once plugin_dir_path( __FILE__ ) . '/api.php';
require_once plugin_dir_path( __FILE__ ) . '/actors.php';
2018-09-19 15:47:51 +00:00
require_once plugin_dir_path( __FILE__ ) . '/db.php';
add_action( 'rest_api_init', function() {
\api\register_routes();
} );
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-19 15:47:51 +00:00
\db\run_migrations();
\actors\initialize_user_actors();
} );
?>