Skip to content

Commit

Permalink
Review nonce. Closes woocommerce#3324.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Jun 14, 2013
1 parent 0204ff2 commit 1e94bbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions includes/helpers/class-wc-template-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class WC_Template_Helper extends WC_Helper {
public $template_url;

public function __construct() {
$this->template_url = apply_filters( 'woocommerce_template_url', 'woocommerce/' );
}
Expand Down Expand Up @@ -73,14 +73,18 @@ public function template_loader( $template ) {
*/
public function comments_template_loader( $template ) {
global $woocommerce;

if ( get_post_type() !== 'product' )
return $template;

if ( file_exists( STYLESHEETPATH . '/' . $this->template_url . 'single-product-reviews.php' ))
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';
}
Expand Down
2 changes: 1 addition & 1 deletion templates/single-product-reviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

}

$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 ) );

Expand Down

0 comments on commit 1e94bbc

Please sign in to comment.