Missing $wpdb

This commit is contained in:
Mike Jolley 2016-08-26 16:15:18 +01:00
parent f034e1f69d
commit 7d8bacc2b3
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ class WC_REST_Coupons_Controller extends WC_REST_Posts_Controller {
* @return WP_Error|stdClass $data Post object.
*/
protected function prepare_item_for_database( $request ) {
global $wpdb;
$id = isset( $request['id'] ) ? absint( $request['id'] ) : 0;
$coupon = new WC_Coupon( $id );
$schema = $this->get_item_schema();