Skip to content

Commit

Permalink
🐛 FIX: config key for network sites
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmoodak committed Jul 5, 2023
1 parent 20fb066 commit 9702ef8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions integrations/integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ abstract class Integration {
* @var array {
* 'client' => array<string, string>,
* 'site' => array<string, string>,
* 'network-sites' => array<string, array<string, string>>,
* 'network_sites' => array<string, array<string, string>>,
* }
*
* @example
* array(
* 'client' => array( 'status' => 'blocked' ),
* 'site' => array( 'status' => 'disabled' ),
* 'network-sites' => array (
* 'network_sites' => array (
* 1 => array (
* 'status' => 'disabled',
* ),
Expand Down Expand Up @@ -178,7 +178,7 @@ private function is_active_by_vip(): bool {
return false;
}

return $this->get_value_from_vip_config( 'network-sites', 'status' ) === Site_Integration_Status::ENABLED;
return $this->get_value_from_vip_config( 'network_sites', 'status' ) === Site_Integration_Status::ENABLED;
}

return Site_Integration_Status::ENABLED === $site_status; // Return site status if not multisite.
Expand All @@ -198,12 +198,12 @@ private function get_value_from_vip_config( string $config_type, string $key ):
}

// Look for key inside client or site config.
if ( 'network-sites' !== $config_type && isset( $this->vip_config[ $config_type ][ $key ] ) ) {
if ( 'network_sites' !== $config_type && isset( $this->vip_config[ $config_type ][ $key ] ) ) {
return $this->vip_config[ $config_type ][ $key ];
}

// Look for key inside network-sites config.
if ( 'network-sites' === $config_type && isset( $this->vip_config[ $config_type ][ get_current_blog_id() ] ) ) {
if ( 'network_sites' === $config_type && isset( $this->vip_config[ $config_type ][ get_current_blog_id() ] ) ) {
if ( isset( $this->vip_config[ $config_type ][ get_current_blog_id() ][ $key ] ) ) {
return $this->vip_config[ $config_type ][ get_current_blog_id() ][ $key ];
}
Expand Down

0 comments on commit 9702ef8

Please sign in to comment.