Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. diff --git a/src/bp-core/admin/bp-core-admin-tools.php b/src/bp-core/admin/bp-core-admin-tools.php
  2. index 2dd0813..98e8183 100644
  3. --- a/src/bp-core/admin/bp-core-admin-tools.php
  4. +++ b/src/bp-core/admin/bp-core-admin-tools.php
  5. @@ -451,6 +451,19 @@ function bp_admin_reinstall_emails() {
  6. }
  7. }
  8.  
  9. + // Make sure we have no orphaned email type terms.
  10. + $email_types = get_terms( bp_get_email_tax_type(), array(
  11. + 'fields' => 'ids',
  12. + 'hide_empty' => false,
  13. + 'update_term_meta_cache' => false,
  14. + ) );
  15. +
  16. + if ( $email_types ) {
  17. + foreach ( $email_types as $term_id ) {
  18. + wp_delete_term( (int) $term_id, bp_get_email_tax_type() );
  19. + }
  20. + }
  21. +
  22. require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
  23. bp_core_install_emails();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement