-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Use prefix instead of parsing our own #7185
Conversation
Enhance compatibility with other plugins. Fixes #7181
PR Summary
|
There was a reason this was in place, I need to go figure out why that was and how to continue supporting that (if it's still a valid reason). |
Walking backwards from most recent to the original introduction of this usage:
Given that, I think your PR looks good -- EXCEPT -- this is not what WP_User uses (as of WP 4.9+) and that's what we need to follow instead here. /**
* Sets the site to operate on. Defaults to the current site.
*
* @since 4.9.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $site_id Site ID to initialize user capabilities for. Default is the current site.
*/
public function for_site( $site_id = '' ) {
global $wpdb;
if ( ! empty( $site_id ) ) {
$this->site_id = absint( $site_id );
} else {
$this->site_id = get_current_blog_id();
}
$this->cap_key = $wpdb->get_blog_prefix( $this->site_id ) . 'capabilities';
$this->caps = $this->get_caps_data();
$this->get_role_caps();
} So the solution here needs to actually be calling |
Just did more digging into the |
Enhance compatibility with other plugins.
Related GitHub issue(s)
Fixes #7181
Changelog text for these changes
PR checklist