From 799f4be1d8d8159ed660f7b7e48f023594341d3c Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 10 Jul 2023 10:29:02 +0200 Subject: [PATCH] check for "single user mode" --- includes/functions.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index c41304d..725d9f6 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -306,11 +306,27 @@ function is_user_disabled( $user_id ) { } } +/** + * Check if the blog is in single-user mode. + * + * @return boolean True if the blog is in single-user mode, false otherwise. + */ +function is_single_user() { + if ( + false === ACTIVITYPUB_DISABLE_BLOG_USER && + true === ACTIVITYPUB_DISABLE_USER + ) { + return true; + } + + return false; +} + if ( ! function_exists( 'get_self_link' ) ) { /** - * Get the correct self URL + * Returns the link for the currently displayed feed. * - * @return boolean + * @return string Correct link for the atom:self element. */ function get_self_link() { $host = wp_parse_url( home_url() );