mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Check if the $wpdb->wc_orders
exists before query.
This commit is contained in:
parent
d711a7b512
commit
960fdc59da
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ class PPECHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
if ( class_exists( OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled() ) {
|
if ( class_exists( OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled() && isset( $wpdb->wc_orders ) ) {
|
||||||
$result = $wpdb->get_var(
|
$result = $wpdb->get_var(
|
||||||
$wpdb->prepare(
|
$wpdb->prepare(
|
||||||
"SELECT 1 FROM {$wpdb->wc_orders} WHERE payment_method = %s",
|
"SELECT 1 FROM {$wpdb->wc_orders} WHERE payment_method = %s",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue