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 18, 2023
1 parent 7f7bfa3 commit df8a42f
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 @@ -48,6 +48,7 @@ public function __construct() {

// New Site Actions
$this->activate_child_theme_on_new_site();
$this->default_child_theme_logo();
}

/**
Expand Down Expand Up @@ -393,4 +394,30 @@ private function init_site_defaults( int $site_id ): void {

restore_current_blog();
}

/**
* 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 df8a42f

Please sign in to comment.