| @@ -38,10 +38,11 @@ | ||
| 38 | 38 | * @param array $args The positional arguments. |
| 39 | 39 | * @param array $assoc_args The associative arguments (unused). |
| 40 | 40 | */ |
| 41 | 41 | public function delete( $args, $assoc_args ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
| 42 | - if ( Actors::APPLICATION_USER_ID === (int) $args[0] ) { | |
| 43 | - \WP_CLI::error( 'You cannot delete the application actor.' ); | |
| 42 | + // Only the blog actor (0) and real users (positive IDs) can be deleted; negative IDs (e.g. the former -1 application ID) are never valid actors. | |
| 43 | + if ( (int) $args[0] < Actors::BLOG_USER_ID ) { | |
| 44 | + \WP_CLI::error( \sprintf( 'No deletable actor found for ID "%s".', $args[0] ) ); | |
| 44 | 45 | } |
| 45 | 46 | |
| 46 | 47 | \add_filter( 'activitypub_user_can_activitypub', '__return_true' ); |
| 47 | 48 | Actor::schedule_user_delete( $args[0] ); |