Skip to content

Instantly share code, notes, and snippets.

@yratof
Created October 27, 2015 09:54
Show Gist options
  • Save yratof/83bb7083e2a3b702a7ec to your computer and use it in GitHub Desktop.
Save yratof/83bb7083e2a3b702a7ec to your computer and use it in GitHub Desktop.
Displat advanced custom fields to Woocommerce Reviews
<?php
add_action( 'woocommerce_review_before_comment_meta', 'comment_title' );
function comment_title(){
$field = get_field('title', 'comment_' . get_comment_ID());
if($field){
echo '<h4>' . $field .'</h4>';
}
}
@typeplus
Copy link

Hello!

Can I get some clarification as to what is required to get this to work? Am i correct in assuming its to add a "title" to the reviews in woocommerce being populated by an ACF field?

Thanks!
T+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment