Skip to content

Commit

Permalink
fix: adjust parameters types for multisite hooks (#295)
Browse files Browse the repository at this point in the history
Expect WP_Site objects instead of site IDs for compatibility with
multisite hooks.

Fixes: d13d5e4
  • Loading branch information
zhyian authored Oct 30, 2024
1 parent 5fcd93f commit 29b3712
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions inc/class-statify-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public static function init( bool $network_wide = false ): void {
*
* @since 1.4.4
*
* @param int $site_id Site ID.
* @param WP_Site $new_site Site object.
*/
public static function init_site( int $site_id ): void {
public static function init_site( WP_Site $new_site ): void {

switch_to_blog( $site_id );
switch_to_blog( $new_site->site_id );

self::_apply();

Expand Down
6 changes: 3 additions & 3 deletions inc/class-statify-uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public static function init(): void {
*
* @since 1.4.4
*
* @param int $site_id Site ID.
* @param WP_Site $old_site Site object.
*/
public static function init_site( int $site_id ): void {
public static function init_site( WP_Site $old_site ): void {

switch_to_blog( $site_id );
switch_to_blog( $old_site->site_id );

self::_apply();

Expand Down

0 comments on commit 29b3712

Please sign in to comment.