Skip to content

Commit

Permalink
[#12] updating default logo to filter
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Dec 14, 2023
1 parent 72a2737 commit 8177971
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions client-mu-plugins/goodbids/src/classes/Network/Sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function __construct() {
$this->new_site_form_fields();
$this->edit_site_form_fields();
$this->activate_child_theme_on_new_site();
$this->default_child_theme_logo();
}

/**
Expand Down Expand Up @@ -374,4 +375,30 @@ function ( $site_id ) {
}
);
}

/**
* Set the GoodBids logo on the child theme.
*
* @since 1.0.0
*
* @return void
*/
private function default_child_theme_logo(): void {
add_filter(
'get_custom_logo',
function ( string $html, int $blog_id ) {
if ( $html ) {
return $html;
}

return sprintf(
'<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url"><img src="%2$s" class="custom-logo" itemprop="logo" alt="GoodBids"></a>',
esc_url( home_url( '/' ) ),
esc_attr( GOODBIDS_PLUGIN_URL . 'assets/images/goodbids-logo.png' ),
);
},
10,
2
);
}
}

0 comments on commit 8177971

Please sign in to comment.