Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Maillage interne page produit
- $maillage = [
- 'ancre 1' => 'https://link',
- 'ancre 2' => 'https://link',
- 'ancre 3' => 'https://link',
- 'ancre 4' => 'https://link'
- ];
- add_filter('woocommerce_short_description', function($desc) use ($maillage){
- if( is_product() ){
- foreach ($maillage as $word => $link) {
- if( strpos($desc, $word) !== false )
- return str_replace($word,'<a href="'.$link.'">'.$word.'</a>', $desc);
- }
- }
- return $desc;
- });
Advertisement
Add Comment
Please, Sign In to add comment