Skip to content

Commit

Permalink
Merge pull request #11 from tfrommen/patch-2
Browse files Browse the repository at this point in the history
Throw error for multisite command if not multisite
  • Loading branch information
roborourke authored Dec 4, 2024
2 parents fbfdc85 + 1172f8d commit 348d061
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion orphan-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
}
unset( $wpcli_orphan_autoloader );

WP_CLI::add_command( 'orphan blog meta', HumanMade\OrphanCommand\Orphan_Blog_Meta_Command::class );
WP_CLI::add_command( 'orphan blog meta', HumanMade\OrphanCommand\Orphan_Blog_Meta_Command::class, [
'before_invoke' => function () {
if ( ! is_multisite() ) {
WP_CLI::error( 'This is not a multisite installation.' );
}
},
] );
WP_CLI::add_command( 'orphan comment', HumanMade\OrphanCommand\Orphan_Comment_Command::class );
WP_CLI::add_command( 'orphan comment meta', HumanMade\OrphanCommand\Orphan_Comment_Meta_Command::class );
WP_CLI::add_command( 'orphan post', HumanMade\OrphanCommand\Orphan_Post_Command::class );
Expand Down

0 comments on commit 348d061

Please sign in to comment.