pterotype/inc/init.php

31 lines
989 B
PHP
Raw Normal View History

<?php
namespace init;
require_once plugin_dir_path( __FILE__ ) . '/outbox.php';
require_once plugin_dir_path( __FILE__ ) . '/api.php';
require_once plugin_dir_path( __FILE__ ) . '/objects.php';
2018-08-29 20:38:10 +00:00
require_once plugin_dir_path( __FILE__ ) . '/activities.php';
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';
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 );
} );
add_action( 'activitypub_init', function() {
2018-08-29 20:38:10 +00:00
\activities\create_activities_table();
\objects\create_object_table();
2018-08-29 20:38:10 +00:00
\outbox\create_outbox_table();
\actors\create_actors_table();
\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();
} );
?>