Last active
January 27, 2023 15:50
-
-
Save PluginRepublicSupport/0c36be0e1accb2a67651ee2ebc2924b1 to your computer and use it in GitHub Desktop.
ACF Fields in Child Products
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
<?php | |
/** | |
*Snippet to add show ACF field content in child product | |
*/ | |
function acf_filter_field($title, $child_product) { | |
return sprintf('<h4>%s</h4><p>%s</p>', | |
$title, | |
get_field('alcool', $child_product->get_ID()) /** Alcohol is the ACF field name **/ | |
); | |
} | |
add_filter( 'pewc_child_product_title', 'acf_filter_field', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment