From: Steve Sutton Date: Wed, 21 Aug 2019 14:53:55 +0000 (-0400) Subject: Adding comments to new method X-Git-Tag: v1.8.0^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=4440b5d2d31b21630a194383e5db782c3cc27bc7;p=WP-Plugins%2Fglm-member-db-events.git Adding comments to new method Updating parameter name to status --- diff --git a/classes/data/dataEvents.php b/classes/data/dataEvents.php index 8cc4c7f..367e6f0 100644 --- a/classes/data/dataEvents.php +++ b/classes/data/dataEvents.php @@ -726,15 +726,24 @@ class GlmDataEvents extends GlmDataAbstract } - public function updateStatus( $id, $newStatus ) + /** + * Update the Status of an event + * + * @param $id Integer Id of event + * @param $status Integer Status number from config/plugin.ini + * + */ + public function updateStatus( $id, $status ) { - $this->wpdb->update( - $this->table, - array( 'status' => $newStatus ), - array( 'id' => $id ), - array( '%d' ), - array( '%d' ) - ); + if ( filter_var( $id, FILTER_VALIDATE_INT ) && filter_var( $status, FILTER_VALIDATE_INT ) ) { + $this->wpdb->update( + $this->table, + array( 'status' => $status ), + array( 'id' => $id ), + array( '%d' ), + array( '%d' ) + ); + } } /**