Skip to content

Conversation

@danielbachhuber
Copy link
Contributor

The array hasn't been run through array_fill_keys() yet, so need to
inspect the array values

The array hasn't been run through `array_fill_keys()` yet, so need to
inspect the array values
@danielbachhuber danielbachhuber added this to the 1.1.4 milestone Oct 21, 2021
@danielbachhuber
Copy link
Contributor Author

@JanThiel FYI - your original logic was broken ^^

@danielbachhuber danielbachhuber merged commit ede1390 into master Oct 21, 2021
@danielbachhuber danielbachhuber deleted the fix-global-group-ignore-logic branch October 21, 2021 15:31
@JanThiel
Copy link
Contributor

@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.

@JanThiel
Copy link
Contributor

But you are absolutely right ... at this point, there are no key => value pairs.
Very strange. Sorry for that ;-)

@danielbachhuber
Copy link
Contributor Author

No worries 😄 Thanks again for the pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants