2018-08-23 02:07:06 +00:00
|
|
|
<?php
|
|
|
|
namespace init;
|
|
|
|
|
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/outbox.php';
|
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/api.php';
|
2018-08-28 23:26:18 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/objects.php';
|
2018-08-29 20:38:10 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/activities.php';
|
2018-09-03 16:47:08 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/actors.php';
|
2018-09-04 02:10:36 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/likes.php';
|
2018-09-04 06:01:34 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/following.php';
|
2018-09-19 12:54:07 +00:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . '/blocks.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-08-23 02:07:06 +00:00
|
|
|
add_action( 'activitypub_init', function() {
|
2018-08-29 20:38:10 +00:00
|
|
|
\activities\create_activities_table();
|
2018-08-28 23:26:18 +00:00
|
|
|
\objects\create_object_table();
|
2018-08-29 20:38:10 +00:00
|
|
|
\outbox\create_outbox_table();
|
2018-09-03 16:47:08 +00:00
|
|
|
\actors\create_actors_table();
|
2018-09-04 01:22:23 +00:00
|
|
|
\actors\initialize_user_actors();
|
2018-09-04 02:10:36 +00:00
|
|
|
\likes\create_likes_table();
|
2018-09-04 06:01:34 +00:00
|
|
|
\following\create_following_table();
|
2018-09-19 12:54:07 +00:00
|
|
|
\blocks\create_blocks_table();
|
2018-08-23 02:07:06 +00:00
|
|
|
} );
|
|
|
|
?>
|