More plugs

This commit is contained in:
Mike Jolley 2011-12-11 15:37:32 +00:00
parent 22afa53087
commit 641033cd21
1 changed files with 42 additions and 36 deletions

View File

@ -2,7 +2,7 @@
/**
* WooCommerce Template Functions
*
* Functions used in the template files to output content - in most cases hooked in via the template actions.
* Functions used in the template files to output content - in most cases hooked in via the template actions. All functions are pluggable.
*
* @package WooCommerce
* @category Core
@ -759,52 +759,58 @@ function woocommerce_subcategory_thumbnail( $category ) {
/**
* Displays order details in a table
**/
function woocommerce_order_details_table( $id ) {
global $woocommerce, $order_id;
if (!function_exists('woocommerce_order_details_table')) {
function woocommerce_order_details_table( $id ) {
global $woocommerce, $order_id;
if (!$id) return;
if (!$id) return;
$order_id = $id;
woocommerce_get_template('order/order-details-table.php', false);
}
$order_id = $id;
woocommerce_get_template('order/order-details-table.php', false);
}
}
/**
* Review comments template
**/
function woocommerce_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; global $post; ?>
if (!function_exists('woocommerce_comments')) {
function woocommerce_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; global $post; ?>
<li itemprop="reviews" itemscope itemtype="http://schema.org/Review" <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>" class="comment_container">
<li itemprop="reviews" itemscope itemtype="http://schema.org/Review" <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>" class="comment_container">
<?php echo get_avatar( $comment, $size='60' ); ?>
<div class="comment-text">
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo esc_attr( get_comment_meta( $comment->comment_ID, 'rating', true ) ); ?>">
<span style="width:<?php echo get_comment_meta( $comment->comment_ID, 'rating', true )*16; ?>px"><span itemprop="ratingValue"><?php echo get_comment_meta( $comment->comment_ID, 'rating', true ); ?></span> <?php _e('out of 5', 'woothemes'); ?></span>
</div>
<?php echo get_avatar( $comment, $size='60' ); ?>
<?php if ($comment->comment_approved == '0') : ?>
<p class="meta"><em><?php _e('Your comment is awaiting approval', 'woothemes'); ?></em></p>
<?php else : ?>
<p class="meta">
<?php _e('Rating by', 'woothemes'); ?> <strong itemprop="author"><?php comment_author(); ?></strong> <?php _e('on', 'woothemes'); ?> <time itemprop="datePublished" time datetime="<?php echo get_comment_date('c'); ?>"><?php echo get_comment_date('M jS Y'); ?></time>:
</p>
<?php endif; ?>
<div class="comment-text">
<div itemprop="description" class="description"><?php comment_text(); ?></div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<?php
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo esc_attr( get_comment_meta( $comment->comment_ID, 'rating', true ) ); ?>">
<span style="width:<?php echo get_comment_meta( $comment->comment_ID, 'rating', true )*16; ?>px"><span itemprop="ratingValue"><?php echo get_comment_meta( $comment->comment_ID, 'rating', true ); ?></span> <?php _e('out of 5', 'woothemes'); ?></span>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<p class="meta"><em><?php _e('Your comment is awaiting approval', 'woothemes'); ?></em></p>
<?php else : ?>
<p class="meta">
<?php _e('Rating by', 'woothemes'); ?> <strong itemprop="author"><?php comment_author(); ?></strong> <?php _e('on', 'woothemes'); ?> <time itemprop="datePublished" time datetime="<?php echo get_comment_date('c'); ?>"><?php echo get_comment_date('M jS Y'); ?></time>:
</p>
<?php endif; ?>
<div itemprop="description" class="description"><?php comment_text(); ?></div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<?php
}
}
/**
* Prevent Cache
**/
function woocommerce_prevent_sidebar_cache() {
echo '<!--mfunc get_sidebar() --><!--/mfunc-->';
if (!function_exists('woocommerce_prevent_sidebar_cache')) {
function woocommerce_prevent_sidebar_cache() {
echo '<!--mfunc get_sidebar() --><!--/mfunc-->';
}
}