content` on `null` * is a fatal error, so answer with an error response instead. */ if ( ! $item ) { return new WP_Error( 'rest_template_not_found', __( 'No templates exist with that id.' ), array( 'status' => 404 ) ); } ////////////////////////////// // END CORE MODIFICATIONS // ////////////////////////////// return parent::prepare_item_for_response( $item, $request ); } }