-
-
Save Forsskieken/61a55f09e2cf46a283c3866a2a0fe415 to your computer and use it in GitHub Desktop.
Elementor: Replace Twitter Icon with new X Icon
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 | |
/* | |
Plugin Name: X is new Twitter | |
Description: Change bird into X | |
Version: 1.0 | |
Author: Your Name | |
*/ | |
add_filter( 'elementor/widget/render_content', function($output){ | |
// replace the | |
$re = '/(<svg[^>]+class="[^"]*e-fab-twitter".*?<path\s+d=")(.+?)(".+?<\/svg>)/s'; | |
$output = preg_replace_callback($re, function($matches){ | |
$path = "M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"; | |
return $matches[1].$path.$matches[3]; | |
}, $output); | |
return $output; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save as zip and then upload this file as a new plugin