Skip to content

Commit

Permalink
[#15] updating PR format
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Dec 12, 2023
1 parent 3e077fe commit ce29d97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client-mu-plugins/goodbids/src/classes/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private function load_config(): bool {
*
* @return mixed
*/
public function get_config( string $key ) : mixed {
public function get_config( string $key ): mixed {
return $this->config[ $key ] ?? null;
}

Expand Down
13 changes: 6 additions & 7 deletions client-mu-plugins/goodbids/src/classes/network/Sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct() {
$this->save_edit_site_fields();
$this->new_site_form_fields();
$this->edit_site_form_fields();
$this->activate_child_theme();
$this->activate_child_theme_on_new_site();
}

/**
Expand Down Expand Up @@ -313,7 +313,7 @@ function ( WP_Site $new_site, array $args ) {
*/
private function save_edit_site_fields(): void {
add_action(
'wp_update_site',
'wp_initialize_site',
/**
* @param WP_Site $new_site New site object.
* @param WP_Site $old_site Old site object.
Expand Down Expand Up @@ -352,23 +352,22 @@ function ( WP_Site $new_site, WP_Site $old_site ) {
*
* @since 1.0.0
*
* @param int $site_id Site ID.
*
* @return void
*/
private function activate_child_theme(): void {
private function activate_child_theme_on_new_site(): void {
add_action(
'wpmu_new_blog',
'wp_initialize_site',
function ( $site_id ) {
$stylesheet = 'goodbids-nonprofit';

// Switch to the new site
switch_to_blog( $site_id );

// Check if we the Goodbids child theme exists
// Check if the Goodbids child theme exists
if ( ! wp_get_theme( $stylesheet )->exists() ) {
return;
}

switch_theme( $stylesheet );

restore_current_blog();
Expand Down

0 comments on commit ce29d97

Please sign in to comment.