Created
December 29, 2020 11:35
-
-
Save reachkamrul/95c39ff3956c3906c53e70ac60c5c8af to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Woocommerce/post category | |
*/ | |
/* Custom Editor SmartCode | |
* {my_product_cat} | |
*/ | |
add_filter('fluentform_editor_shortcode_callback_my_product_cat', function ($val) { | |
global $post; | |
$terms = get_the_terms( $post->ID, 'product_cat' ); | |
foreach ($terms as $term ) { | |
$product_cat_name = $term->name; | |
break; | |
} | |
return $product_cat_name . ' '; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment