Sometimes it's the small things that make the difference… there is a minor typo in the Divi Social Media Follow module that was present in Divi 4, and (currently) remains in Divi 5. Specifically, the tooltip for Flickr is misspelled as "Flikr". Here's how to fix it.
Fix the Flickr Typo in the Divi Social Media Follow Module using PHP
To fix the typo, in Divi 5 only, you can add the following PHP code to your site:
// === Corrects title="flikr" to title="flickr" in Divi 5 Social Media Follow network items using render_block. ===
add_filter('render_block', 'db_fix_flickr_title_typo', 10, 2);
function db_fix_flickr_title_typo($block_content, $block) {
if (!is_string($block_content)) {
return $block_content;
}
$name = is_array($block) && isset($block['blockName']) ? $block['blockName'] : '';
if ($name !== 'divi/social-media-follow-network') {
return $block_content;
}
// Quick guard: only proceed if the typo is present at all.
if (strpos($block_content, 'flikr') === false) {
return $block_content;
}
// Replace only the exact title attribute value flikr (single or double quotes),
// avoiding data-title, aria-* and other attributes.
$pattern = '/(?<![a-zA-Z0-9_-])title\s*=\s*(["\'])flikr\1/';
$replacement = 'title=$1flickr$1';
$fixed = preg_replace($pattern, $replacement, $block_content);
return is_string($fixed) ? $fixed : $block_content;
} You can add this in the functions.php file of a child theme, or using a plugin such as Code Snippets.
Related Post: Adding PHP to the Divi Theme



0 Comments