Skip to content

Commit

Permalink
Cache clean-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
JJJ committed Apr 3, 2017
1 parent 888d7e3 commit f9a96cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wp-site-aliases/includes/classes/class-wp-site-alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public function delete() {
}

// Delete alias meta
$alias_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->blog_aliasmeta} WHERE blog_alias_id = %d ", $alias_id ) );
$alias_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->blog_aliasmeta} WHERE blog_alias_id = %d", $alias_id ) );
foreach ( $alias_meta_ids as $mid ) {
delete_metadata_by_mid( 'blog_alias', $mid );
}
Expand Down
5 changes: 3 additions & 2 deletions wp-site-aliases/includes/functions/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ function clean_blog_alias_cache( $alias ) {
return;
}

// Delete alias from cache group
wp_cache_delete( $alias->id , 'blog-aliases' );
// Delete alias from cache groups
wp_cache_delete( $alias->id , 'blog-aliases' );
wp_cache_delete( $alias->id , 'blog_alias_meta' );

/**
* Fires immediately after a site alias has been removed from the object cache.
Expand Down

0 comments on commit f9a96cc

Please sign in to comment.