Created
March 6, 2014 20:57
-
-
Save billerickson/9399465 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$reviews = get_post_meta( get_the_ID(), '_lc_recipe_testerschoice', true ); | |
if ( empty( $reviews ) || empty( $reviews[0]['name'] ) || intval( $reviews[0]['name'] ) === 0 ) | |
return; | |
echo '<div class="recipe-testers">'; | |
lc_section_title( 'Testers Choice', 'h3', true, '', '' ); | |
foreach( $reviews as $review ) { | |
$id = intval( $review['name'] ); | |
if ( $id !== 0 ) { | |
$name = get_term( intval( $review['name'] ), 'recipe_testers' ); | |
echo '<div class="recipe-tester-comment">'; | |
echo '<div class="recipe-tester-name">'; | |
echo get_avatar( 'testers@leitesculinaria.com', 48 ); | |
$link = get_term_link( $name, 'recipe_testers' ); | |
if( $link && !is_wp_error( $link) ) | |
echo '<h6><a href="' . get_term_link( $name, 'recipe_testers' ) . '" rel="nofollow">' . $name->name . '</a></h6>'; | |
echo '<p class="recipe-tester-date">'; | |
echo get_the_date(); | |
if ( current_user_can( 'moderate_comments' ) ) { | |
$url = get_edit_post_link( get_the_ID() ) . '#lc-testers-choice'; | |
echo ' · <a href="' . $url . '">Edit</a>'; | |
} | |
echo '</p>'; | |
echo '</div>'; | |
echo wpautop( $review['text'] ); | |
echo '</div>'; | |
} | |
} | |
echo '</div>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment