PluginProbe
ActivityPub / 9.2.1
ActivityPub v9.2.1
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/cli/class-actor-command.php +3 -2 8.2.19.2.1 View file →
@@ -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] );