Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add force loading order login for multisite #143

Open
pcfreak30 opened this issue Jan 14, 2020 · 3 comments
Open

Add force loading order login for multisite #143

pcfreak30 opened this issue Jan 14, 2020 · 3 comments

Comments

@pcfreak30
Copy link

You have Pantheon_Sessions::force_first_load which handles normal wp, but it should also run the same process on the network option active_sitewide_plugins

@danielbachhuber
Copy link
Contributor

Thanks for the suggestion, @pcfreak30. We might also want to do #132 too.

@pcfreak30
Copy link
Author

pcfreak30 commented Jan 14, 2020

Rough code change I just had to make on a site, though the timestamp doesn't sem to get preserved

                $path    = plugin_basename(__FILE__);
                $plugins = get_site_option( 'active_sitewide_plugins' );
                if ( $plugins ) {
                        $plugins = array_flip($plugins);
                        $key = array_search( $path, $plugins, true );
                        array_splice( $plugins, $key, 1 );
                        array_unshift( $plugins, $path );
                        $plugins = array_flip($plugins);
                        update_site_option( 'active_sitewide_plugins', $plugins );
                }

                return;
        }

active_sitewide_plugins seems to use a basename => timestamp format.

@pcfreak30
Copy link
Author

It also seems the timestamps are somehow important for the plugins to load, so the above code is partially flawed but a starting point.

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

No branches or pull requests

2 participants