File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1515
1616namespace Activitypub ;
1717
18+ use function Activitypub \is_blog_public ;
1819use function Activitypub \site_supports_blocks ;
1920
2021require_once __DIR__ . '/includes/compat.php ' ;
@@ -52,7 +53,7 @@ function rest_init() {
5253 Rest \Collection::init ();
5354
5455 // load NodeInfo endpoints only if blog is public
55- if ( \get_option ( ' blog_public ' , 1 ) ) {
56+ if ( is_blog_public ( ) ) {
5657 Rest \NodeInfo::init ();
5758 }
5859}
Original file line number Diff line number Diff line change @@ -472,3 +472,12 @@ function site_supports_blocks() {
472472function is_json ( $ data ) {
473473 return \is_array ( \json_decode ( $ data , true ) ) ? true : false ;
474474}
475+
476+ /**
477+ * Check if a blog is public based on the `blog_public` option
478+ *
479+ * @return bollean True if public, false if not
480+ */
481+ function is_blog_public () {
482+ return (bool ) apply_filters ( 'activitypub_is_blog_public ' , \get_option ( 'blog_public ' , 1 ) );
483+ }
You can’t perform that action at this time.
0 commit comments