Closed danielbachhuber closed 2 years ago
@JanThiel FYI - your original logic was broken ^^
@danielbachhuber Strange ... I have this working with array_diff_keys
on our servers.
public function add_global_groups( $groups ) {
$groups = (array) $groups;
// Filter global groups
$groups = array_diff_key( $groups, WP_REDIS_IGNORE_GLOBAL_GROUPS );
$groups = array_fill_keys( $groups, true );
$this->global_groups = array_merge( $this->global_groups, $groups );
}
wp> print_r($GLOBALS['wp_object_cache']->global_groups)
Array
(
[site-transient] => 1
[site-options] => 1
[blog-lookup] => 1
[blog-details] => 1
[site-details] => 1
[rss] => 1
[global-posts] => 1
[blog-id-cache] => 1
[networks] => 1
[sites] => 1
[blog_meta] => 1
)
But thanks for fixing and letting me know.
But you are absolutely right ... at this point, there are no key => value pairs. Very strange. Sorry for that ;-)
No worries 😄 Thanks again for the pull request!
The array hasn't been run through
array_fill_keys()
yet, so need to inspect the array values