Review nonce. Closes #3324.

This commit is contained in:
Mike Jolley 2013-06-14 16:15:26 +01:00
parent 0204ff231a
commit 1e94bbc990
2 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,7 @@ return new WC_Template_Helper();
class WC_Template_Helper extends WC_Helper {
public $template_url;
public function __construct() {
$this->template_url = apply_filters( 'woocommerce_template_url', 'woocommerce/' );
}
@ -73,7 +73,7 @@ class WC_Template_Helper extends WC_Helper {
*/
public function comments_template_loader( $template ) {
global $woocommerce;
if ( get_post_type() !== 'product' )
return $template;
@ -81,6 +81,10 @@ class WC_Template_Helper extends WC_Helper {
return STYLESHEETPATH . '/' . $this->template_url . 'single-product-reviews.php';
elseif ( file_exists( TEMPLATEPATH . '/' . $this->template_url . 'single-product-reviews.php' ))
return TEMPLATEPATH . '/' . $this->template_url . 'single-product-reviews.php';
elseif ( file_exists( STYLESHEETPATH . '/' . 'single-product-reviews.php' ))
return STYLESHEETPATH . '/' . 'single-product-reviews.php';
elseif ( file_exists( TEMPLATEPATH . '/' . 'single-product-reviews.php' ))
return TEMPLATEPATH . '/' . 'single-product-reviews.php';
else
return $woocommerce->plugin_path() . '/templates/single-product-reviews.php';
}

View File

@ -104,7 +104,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
}
$comment_form['comment_field'] .= '<p class="comment-form-comment"><label for="comment">' . __( 'Your Review', 'woocommerce' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>' . wp_nonce_field( 'woocommerce-comment_rating', true, false);
$comment_form['comment_field'] .= '<p class="comment-form-comment"><label for="comment">' . __( 'Your Review', 'woocommerce' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' . wp_nonce_field( 'woocommerce-comment_rating', '_wpnonce', true, false ) . '</p>';
comment_form( apply_filters( 'woocommerce_product_review_comment_form_args', $comment_form ) );