Skip to content

Commit

Permalink
Fix: recreate-network-alias throw error on single site
Browse files Browse the repository at this point in the history
  • Loading branch information
burhandodhy committed Jul 26, 2022
1 parent 1c47459 commit 1a96b13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/classes/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ public function recreate_network_alias( $args, $assoc_args ) {
$this->connect_check();
$this->index_occurring();

if ( ! defined( 'EP_IS_NETWORK' ) || ! EP_IS_NETWORK ) {
WP_CLI::error( esc_html__( 'ElasticPress is not activated on network.', 'elasticpress' ) );
}

$indexables = Indexables::factory()->get_all( false );

foreach ( $indexables as $indexable ) {
Expand Down

0 comments on commit 1a96b13

Please sign in to comment.