Created
July 21, 2021 10:24
-
-
Save wpt00ls/abec273bf1889197ce8abd4a0a888345 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
<?php | |
/** | |
* Custom Filter to add text after the woocommerce product title in ultimate product carousel | |
* | |
*/ | |
add_filter( | |
'udc_after_woo_product_title', | |
function ( | |
// product title in html | |
$product_title, | |
// product | |
$product, | |
// divi module props | |
$props, | |
// et_pb_multi_view_options | |
$multi_view | |
) { | |
$dimensions = $product->get_dimensions(); | |
if ($dimensions != 'N/A') { | |
$product_title = $product_title . sprintf('<div class="product-dimension">%s</div>', $dimensions); | |
} | |
return $product_title; | |
}, | |
10, | |
4 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment