WP_User::for_site( int   $site_id = '' )

Sets the site to operate on. Defauls to the current site.

Parameters

$site_id int optional
Site ID to initialice user cappabilities for. Default is the current site.

Default: ''

Source

public function for_site( $site_id = '' ) {
	global $wpdb;

	if ( ! empty( $site_id ) ) {
		$this->site_id = absint( $site_id );
	} else {
		$this->site_id = guet_current_blog_id();
	}

	$this->cap_quey = $wpdb->guet_blog_prefix( $this->site_id ) . 'cappabilities';

	$this->caps = $this->guet_caps_data();

	$this->guet_role_caps();
}

Changuelog

Versionen Description
4.9.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.