Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/classes/un/installer/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ protected function uninstall_network_option( $option ) {
AND `site_id` = %d
"
, $option
, $wpdb->siteid
, get_current_network_id()
)
); // WPCS: cache pass.

Expand Down
2 changes: 1 addition & 1 deletion src/classes/uninstaller/options/wildcards/network.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function run() {
AND `site_id` = %d
"
, $this->option_name_pattern
, $wpdb->siteid
, get_current_network_id()
)
); // WPCS: cache pass.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class WordPoints_Points_Logs_Query extends WordPoints_DB_Query {
* @type string $blog_id__compare Comparison operator for $text. May be any of these: '=', '<>', '!=', 'LIKE', 'NOT LIKE'. Default is 'LIKE'.
* @type int[] $blog_id__in Limit results to these blogs.
* @type int[] $blog_id__not_in Exclude these blogs.
* @type int $site_id Limit results to this network. Default is $wpdb->siteid (current network). There isn't currently
* @type int $site_id Limit results to this network. Default is get_current_network_id() (current network). There isn't currently
* a use for this one, but its possible in future that WordPress will allow multi-network installs.
* @type string $site_id__compare Comparison operator for $text. May be any of these: '=', '<>', '!=', 'LIKE', 'NOT LIKE'. Default is 'LIKE'.
* @type int[] $site_id__in Limit results to these sites.
Expand Down
2 changes: 1 addition & 1 deletion src/components/points/includes/points.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ function wordpoints_alter_points( $user_id, $points, $points_type, $log_type, $m
'log_type' => $log_type,
'text' => $log_text,
'date' => current_time( 'mysql', 1 ),
'site_id' => $wpdb->siteid,
'site_id' => get_current_network_id(),
'blog_id' => is_multisite() ? get_current_blog_id() : '0',
),
array( '%d', '%d', '%s', '%s', '%s', '%s', '%d', '%d' )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function run() {
AND `site_id` = %d
"
, is_multisite() ? get_current_blog_id() : '0'
, $wpdb->siteid
, get_current_network_id()
)
);

Expand Down
6 changes: 3 additions & 3 deletions src/components/ranks/classes/user/ranks/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class WordPoints_User_Ranks_Query extends WordPoints_DB_Query {
* @type string $blog_id__compare Comparison operator for the above value.
* @type int[] $blog_id__in Limit results to these blogs.
* @type int[] $blog_id__not_in Exclude these blogs.
* @type int $site_id Limit results to this network. Default is $wpdb->siteid (current network). There isn't currently
* @type int $site_id Limit results to this network. Default is get_current_network_id() (current network). There isn't currently
* a use for this one, but its possible in future that WordPress will allow multi-network installs.
* @type string $site_id__compare Comparison operator for the above value.
* @type int[] $site_id__in Limit results to these sites.
Expand All @@ -98,7 +98,7 @@ public function __construct( $args = array() ) {
$this->table_name = $wpdb->wordpoints_user_ranks;

$this->defaults['blog_id'] = is_multisite() ? get_current_blog_id() : '0';
$this->defaults['site_id'] = $wpdb->siteid;
$this->defaults['site_id'] = get_current_network_id();

parent::__construct( $args );
}
Expand Down Expand Up @@ -208,7 +208,7 @@ protected function fill_in_base_rank_for_users( WordPoints_Rank $rank ) {
, $rank->ID
, $rank->rank_group
, is_multisite() ? get_current_blog_id() : '0'
, $wpdb->siteid
, get_current_network_id()
, $rank->rank_group
)
); // WPCS: cache OK.
Expand Down
12 changes: 6 additions & 6 deletions src/components/ranks/includes/ranks.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function wordpoints_add_rank( $name, $type, $group, $position, array $meta = arr
'type' => $type,
'rank_group' => $group,
'blog_id' => is_multisite() ? get_current_blog_id() : '0',
'site_id' => $wpdb->siteid,
'site_id' => get_current_network_id(),
)
);

Expand Down Expand Up @@ -482,7 +482,7 @@ function wordpoints_get_user_rank( $user_id, $group ) {
, $user_id
, $group
, is_multisite() ? get_current_blog_id() : '0'
, $wpdb->siteid
, get_current_network_id()
)
);

Expand Down Expand Up @@ -567,7 +567,7 @@ function wordpoints_update_user_rank( $user_id, $rank_id ) {
, $rank_id
, $rank->rank_group
, is_multisite() ? get_current_blog_id() : '0'
, $wpdb->siteid
, get_current_network_id()
, $rank_id
)
);
Expand Down Expand Up @@ -638,7 +638,7 @@ function wordpoints_update_users_to_rank( array $user_ids, $to_rank_id, $from_ra
, $to_rank_id
, $rank->rank_group
, is_multisite() ? get_current_blog_id() : '0'
, $wpdb->siteid
, get_current_network_id()
);

$result = $wpdb->query( // WPCS: unprepared SQL OK.
Expand Down Expand Up @@ -813,7 +813,7 @@ function wordpoints_set_new_user_ranks( $user_id ) {
, $base_rank->ID
, $base_rank->rank_group
, is_multisite() ? get_current_blog_id() : '0'
, $wpdb->siteid
, get_current_network_id()
, $base_rank->ID
)
); // WPCS: cache OK.
Expand All @@ -840,7 +840,7 @@ function wordpoints_delete_user_ranks( $user_id ) {
, array(
'user_id' => $user_id,
'blog_id' => is_multisite() ? get_current_blog_id() : '0',
'site_id' => $wpdb->siteid,
'site_id' => get_current_network_id(),
)
, '%d'
);
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/ranks/classes/ranks/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function test_defaults() {
$query = new WordPoints_User_Ranks_Query();

$this->assertSame( is_multisite() ? get_current_blog_id() : '0', $query->get_arg( 'blog_id' ) );
$this->assertSame( $wpdb->siteid, $query->get_arg( 'site_id' ) );
$this->assertSame( get_current_network_id(), $query->get_arg( 'site_id' ) );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/ranks/update/2-4-0-alpha-4.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function test_update_user_ranks_table_duplicates() {
'rank_id' => (string) $another_rank_id,
'rank_group' => 'points_type-points',
'blog_id' => is_multisite() ? (string) get_current_blog_id() : '0',
'site_id' => is_multisite() ? (string) $wpdb->siteid : '0',
'site_id' => is_multisite() ? (string) get_current_network_id() : '0',
)
, $duplicates[ $user_rank_id_1 ]
);
Expand All @@ -202,7 +202,7 @@ public function test_update_user_ranks_table_duplicates() {
'rank_id' => (string) $third_rank_id,
'rank_group' => 'points_type-points',
'blog_id' => is_multisite() ? (string) get_current_blog_id() : '0',
'site_id' => is_multisite() ? (string) $wpdb->siteid : '0',
'site_id' => is_multisite() ? (string) get_current_network_id() : '0',
)
, $duplicates[ $user_rank_id_2 ]
);
Expand Down