Skip to content

Commit

Permalink
Delete alias meta when deleting an alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
JJJ committed Apr 3, 2017
1 parent c158071 commit 888d7e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wp-site-aliases/includes/classes/class-wp-site-alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ public function delete() {
return new WP_Error( 'wp_site_aliases_alias_delete_failed' );
}

// 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 ) );
foreach ( $alias_meta_ids as $mid ) {
delete_metadata_by_mid( 'blog_alias', $mid );
}

// Delete the blog alias cache
clean_blog_alias_cache( $this );

Expand Down

0 comments on commit 888d7e3

Please sign in to comment.