diff --git a/activitypub.php b/activitypub.php index 69ecbaaf..dd404695 100644 --- a/activitypub.php +++ b/activitypub.php @@ -45,6 +45,10 @@ require_once __DIR__ . '/includes/functions.php'; \defined( 'ACTIVITYPUB_SEND_VARY_HEADER' ) || \define( 'ACTIVITYPUB_SEND_VARY_HEADER', false ); \defined( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE' ) || \define( 'ACTIVITYPUB_DEFAULT_OBJECT_TYPE', 'note' ); +\define( 'ACTIVITYPUB_ACTOR_MODE', '1' ); +\define( 'ACTIVITYPUB_BLOG_MODE', '2' ); +\define( 'ACTIVITYPUB_ACTOR_AND_BLOG_MODE', '3' ); + \define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); \define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); \define( 'ACTIVITYPUB_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) ); diff --git a/includes/class-migration.php b/includes/class-migration.php index 4fda100f..d112fd7c 100644 --- a/includes/class-migration.php +++ b/includes/class-migration.php @@ -273,17 +273,17 @@ class Migration { '1' === $blog_profile && '1' === $author_profiles ) { - \update_option( 'activitypub_actor_mode', '3' ); + \update_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_AND_BLOG_MODE ); } elseif ( '1' === $blog_profile && '1' !== $author_profiles ) { - \update_option( 'activitypub_actor_mode', '2' ); + \update_option( 'activitypub_actor_mode', ACTIVITYPUB_BLOG_MODE ); } elseif ( '1' !== $blog_profile && '1' === $author_profiles ) { - \update_option( 'activitypub_actor_mode', '1' ); + \update_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ); } } diff --git a/includes/functions.php b/includes/functions.php index 62a15355..8c157e74 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -479,7 +479,7 @@ function is_user_type_disabled( $type ) { break; } - if ( '1' === \get_option( 'activitypub_actor_mode', '1' ) ) { + if ( ACTIVITYPUB_ACTOR_MODE === \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ) { $return = true; break; } @@ -499,7 +499,7 @@ function is_user_type_disabled( $type ) { break; } - if ( '2' === \get_option( 'activitypub_actor_mode', '1' ) ) { + if ( ACTIVITYPUB_BLOG_MODE === \get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE ) ) { $return = true; break; } diff --git a/templates/settings.php b/templates/settings.php index 85c9a9a8..55d2f917 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -26,7 +26,7 @@

@@ -38,7 +38,7 @@

@@ -47,7 +47,7 @@