Use unformatted coupon post title for comparison

Fixes #10476
This commit is contained in:
Mike Jolley 2016-03-04 15:55:46 +00:00
parent 927941e2ca
commit 1979138666
1 changed files with 3 additions and 2 deletions

View File

@ -132,9 +132,10 @@ class WC_Coupon {
}
// Otherwise get ID from the code
$this->id = $this->get_coupon_id_from_code( $this->code );
$this->id = $this->get_coupon_id_from_code( $this->code );
$coupon_post = get_post( $this->id );
if ( $this->code === apply_filters( 'woocommerce_coupon_code', get_the_title( $this->id ) ) ) {
if ( $coupon_post && $this->code === apply_filters( 'woocommerce_coupon_code', $coupon_post->post_title ) ) {
$this->populate();
return true;
}