Skip to content

Commit

Permalink
Merge pull request #832 from mauteri/feature/cache-key-id-issue
Browse files Browse the repository at this point in the history
Issue with cache key `id` not being deleted.
  • Loading branch information
rebeccahum authored Dec 6, 2021
2 parents 5d81211 + 006add5 commit b8286ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion php/class-coauthors-guest-authors.php
Original file line number Diff line number Diff line change
Expand Up @@ -1214,14 +1214,16 @@ public function delete_guest_author_cache( $id_or_object ) {

// Delete the lookup cache associated with each old co-author value
$keys = wp_list_pluck( $this->get_guest_author_fields(), 'key' );
$keys = array_merge( $keys, array( 'login', 'post_name', 'user_nicename', 'ID' ) );
$keys = array_merge( $keys, array( 'login', 'post_name', 'user_nicename', 'ID', 'id' ) );
foreach ( $keys as $key ) {
$value_key = $key;

if ( 'post_name' == $key ) {
$value_key = 'user_nicename';
} elseif ( 'login' == $key ) {
$value_key = 'user_login';
} elseif ( 'id' == $key ) {
$value_key = 'ID';
}

$cache_key = $this->get_cache_key( $key, $guest_author->$value_key );
Expand Down

0 comments on commit b8286ae

Please sign in to comment.