Skip to content

Commit

Permalink
Merge commit '8fce8f5fe5ef4b346a14f4de76be3062d171a34d' into release/…
Browse files Browse the repository at this point in the history
…v1.1.2
  • Loading branch information
jasonbahl committed Jun 26, 2023
2 parents fc5e97b + 8fce8f5 commit e3ca36c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Cache/Invalidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function purge( $key, $event = 'undefined event' ) {
* @param mixed|string|int $id The node entity identifier
* @param string $event The event that caused the purge
*/
public function purge_nodes( $id_prefix, $id, $event = '' ) {
public function purge_nodes( $id_prefix, $id, $event = 'unknown event' ) {
if ( ! method_exists( Relay::class, 'toGlobalId' ) ) {
return;
}
Expand Down Expand Up @@ -439,7 +439,7 @@ public function on_saved_term_cb( $term_id, $tt_id, $taxonomy, $update, $args =
$tax_object = get_taxonomy( $taxonomy );

// Delete the cached results associated with this post/key
$this->purge_nodes( 'term', $term->term_id );
$this->purge_nodes( 'term', $term->term_id, 'term_saved' );

$type_name = strtolower( $tax_object->graphql_single_name );

Expand Down Expand Up @@ -469,7 +469,7 @@ public function on_deleted_term_relationship_cb( $object_id, $tt_id, $taxonomy )
$tax_object = get_taxonomy( $taxonomy );

// Delete the cached results associated with this post/key
$this->purge_nodes( 'term', $term->term_id );
$this->purge_nodes( 'term', $term->term_id, 'term_relationship_deleted' );
$type_name = strtolower( $tax_object->graphql_single_name );
$this->purge( 'list:' . $type_name, 'term_relationship_deleted' );
}
Expand All @@ -495,11 +495,7 @@ public function on_added_term_relationship_cb( $object_id, $tt_id, $taxonomy ) {
}

// Delete the cached results associated with this post/key
$this->purge_nodes( 'term', $term->term_id, 'term_edited' );

$tax_object = get_taxonomy( $term->taxonomy );
$type_name = strtolower( $tax_object->graphql_single_name );
$this->purge( 'list:' . $type_name, 'term_edited' );
$this->purge_nodes( 'term', $term->term_id, 'term_relationship_added' );
}

/**
Expand Down

0 comments on commit e3ca36c

Please sign in to comment.