Merge pull request #92 from mediaformat/nodeinfo-if-public
Only return nodeinfo data if site is public
This commit is contained in:
commit
6b3f26202c
1 changed files with 5 additions and 3 deletions
|
@ -13,10 +13,12 @@ class Nodeinfo {
|
|||
* Initialize the class, registering WordPress hooks
|
||||
*/
|
||||
public static function init() {
|
||||
if ( 1 === get_option( 'blog_public', 1 ) ) {
|
||||
\add_action( 'rest_api_init', array( '\Activitypub\Rest\Nodeinfo', 'register_routes' ) );
|
||||
\add_filter( 'nodeinfo_data', array( '\Activitypub\Rest\Nodeinfo', 'add_nodeinfo_discovery' ), 10, 2 );
|
||||
\add_filter( 'nodeinfo2_data', array( '\Activitypub\Rest\Nodeinfo', 'add_nodeinfo2_discovery' ), 10 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register routes
|
||||
|
|
Loading…
Reference in a new issue