Skip to content

Commit

Permalink
check if $term->term_id is set before using it delete the term
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejipa committed Aug 23, 2023
1 parent 45dbb83 commit f732f9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion co-authors-plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,10 @@ function delete_user_action( $delete_id ) {
if ( is_object( $delete_user ) ) {
// Delete term
$term = $this->get_author_term( $delete_user );
wp_delete_term( $term->term_id, $this->coauthor_taxonomy );

if ( isset( $term->term_id ) ) {
wp_delete_term( $term->term_id, $this->coauthor_taxonomy );
}
}

if ( $this->is_guest_authors_enabled() ) {
Expand Down

0 comments on commit f732f9e

Please sign in to comment.