From 2d2fe8402a57034f92a44b4be13d3124753e0293 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 29 Jan 2023 15:39:45 +0100 Subject: Fix silly typo in Venues class. --- includes/class-giglogadmin-venue.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'includes/class-giglogadmin-venue.php') diff --git a/includes/class-giglogadmin-venue.php b/includes/class-giglogadmin-venue.php index 0b73d24..049f117 100644 --- a/includes/class-giglogadmin-venue.php +++ b/includes/class-giglogadmin-venue.php @@ -85,14 +85,14 @@ if ( ! class_exists( 'GiglogAdmin_Venue' ) ) { public static function get( int $id ) : ?self { global $wpdb; - $results = $wpdb->get_results( + $res = $wpdb->get_results( $wpdb->prepare( "SELECT * from {$wpdb->prefix}giglogadmin_venues WHERE id = %d", $id ) ); - if ( ! $result ) { + if ( ! $res ) { error_log( "GiglogAdmin: Query for Venue with id={$id} returned null." ); return null; - } elseif ( count( $results ) > 1 ) { + } elseif ( count( $res ) > 1 ) { error_log( "GiglogAdmin: Query for venye with id={$id} returned " . count( $result ) @@ -101,7 +101,7 @@ if ( ! class_exists( 'GiglogAdmin_Venue' ) ) { return null; } - return new GiglogAdmin_Venue( $results[0] ); + return new GiglogAdmin_Venue( $res[0] ); } /** -- cgit v1.2.3