Skip to content

Commit 121ee00

Browse files
committed
refactor: db query placeholders
1 parent 6ca99b2 commit 121ee00

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

includes/Actions/Affiliate/AffiliateController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static function getAllAffiliate()
4444

4545
global $wpdb;
4646
$affiliatesIds = $wpdb->get_results(
47-
$wpdb->prepare('SELECT affiliate_Id FROM %s', $wpdb->prefix . 'affiliate_wp_affiliates')
47+
$wpdb->prepare('SELECT affiliate_Id FROM %1s', $wpdb->prefix . 'affiliate_wp_affiliates')
4848
);
4949

5050
foreach ($affiliatesIds as $val) {

includes/Actions/LifterLms/LifterLmsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function getAllLifterLmsCourse()
7474

7575
$allCourse = $wpdb->get_results(
7676
$wpdb->prepare(
77-
"SELECT ID, post_title FROM %s WHERE %s = 'publish' AND %s = 'course' ORDER BY post_title",
77+
"SELECT ID, post_title FROM %1s WHERE %2s = 'publish' AND %3s = 'course' ORDER BY post_title",
7878
$wpdb->posts,
7979
$wpdb->posts . '.post_status',
8080
$wpdb->posts . '.post_type'
@@ -90,7 +90,7 @@ public static function getAllLifterLmsMembership()
9090

9191
$allMembership = $wpdb->get_results(
9292
$wpdb->prepare(
93-
"SELECT ID, post_title FROM %s WHERE %s = 'publish' AND %s = 'llms_membership' ORDER BY post_title",
93+
"SELECT ID, post_title FROM %1s WHERE %2s = 'publish' AND %3s = 'llms_membership' ORDER BY post_title",
9494
$wpdb->posts,
9595
$wpdb->posts . '.post_status',
9696
$wpdb->posts . '.post_type'

includes/Actions/PaidMembershipPro/PaidMembershipProController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function getAllPaidMembershipProLevel()
2828
global $wpdb;
2929

3030
$levels = $wpdb->get_results(
31-
$wpdb->prepare('SELECT * FROM %s ORDER BY id ASC', $wpdb->pmpro_membership_levels)
31+
$wpdb->prepare('SELECT * FROM %1s ORDER BY id ASC', $wpdb->pmpro_membership_levels)
3232
);
3333

3434
$allLevels = [];

includes/Core/Util/UnInstallation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function uninstall()
4040
foreach ($tableArray as $tablename) {
4141
$wpdb->query(
4242
$wpdb->prepare(
43-
'DROP TABLE IF EXISTS %s',
43+
'DROP TABLE IF EXISTS %1s',
4444
$tablename
4545
)
4646
);

includes/Triggers/FallbackTrigger/TriggerFallback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ public static function getBuddyBossProfileField()
16391639
global $wpdb;
16401640
$table_name = $wpdb->prefix . 'bp_xprofile_fields';
16411641

1642-
$query = $wpdb->prepare('SELECT id, type, name FROM %s', $table_name);
1642+
$query = $wpdb->prepare('SELECT id, type, name FROM %1s', $table_name);
16431643

16441644
return $wpdb->get_results($query);
16451645
}

0 commit comments

Comments
 (0)