mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
https://stackoverflow.com/questions/69724995/removing-links-from-product-description-woocommerce
8 lines
284 B
Text
8 lines
284 B
Text
function remove_links_from_product_descriptions ( $content ) {
|
|
if ( is_product() ) {
|
|
$content = preg_replace('#<a.*?>(.*?)</a>#i', '\1', $content);
|
|
return $content;
|
|
}
|
|
return $content;
|
|
}
|
|
add_filter( 'the_content', 'remove_links_from_product_descriptions');
|