Skip to content

Commit

Permalink
Merge pull request #46 from tombroucke/master
Browse files Browse the repository at this point in the history
Fix for multisite
  • Loading branch information
timohubois authored Nov 5, 2023
2 parents 8e1bfc9 + 7bb477a commit c6ab636
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions intuitive-custom-post-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function hicpo_uninstall() {
switch_to_blog( $blog_id );
hicpo_uninstall_db_terms();
}
switch_to_blog( $curr_blog );
restore_current_blog();
hicpo_uninstall_db_blogs();
} else {
hicpo_uninstall_db_terms();
Expand Down Expand Up @@ -919,10 +919,9 @@ public function hicpo_sites_clauses( $pieces = [] ) {
return $pieces;
}
if ( 1 != $blog_id ) {
$current = $blog_id;
switch_to_blog( 1 );
$hicpo_network_sites = get_option( 'hicpo_network_sites' );
switch_to_blog( $current );
restore_current_blog();
if ( ! $hicpo_network_sites ) {
return $pieces;
}
Expand All @@ -945,10 +944,9 @@ public function hicpo_sites_clauses( $pieces = [] ) {
public function hicpo_get_blogs_of_user( $blogs ) {
global $blog_id;
if ( 1 != $blog_id ) {
$current = $blog_id;
switch_to_blog( 1 );
$hicpo_network_sites = get_option( 'hicpo_network_sites' );
switch_to_blog( $current );
restore_current_blog();
if ( ! $hicpo_network_sites ) {
return $blogs;
}
Expand Down Expand Up @@ -1015,10 +1013,8 @@ public function refresh_front_network() {
if ( version_compare( $wp_version, '4.6.0' ) < 0 ) {
global $blog_id;
if ( 1 != $blog_id ) {
$current = $blog_id;
switch_to_blog( 1 );
$hicpo_network_sites = get_option( 'hicpo_network_sites' );
switch_to_blog( $current );
restore_current_blog();
if ( ! $hicpo_network_sites ) {
return;
}
Expand Down

0 comments on commit c6ab636

Please sign in to comment.