Backslashes being removed from code snippets
-
First of all, great work on adding code snippets to the plugin as I need 1 less plugin now however, I have run into an issue.
I am adding an ALT text to the Gravatar in WordPress by following the guide here https://bloggerpilot.com/en/gravatar-alt-tag/ but when you insert the code they recommend your plugin strips away all the backslahes and I can’t activate the snippet. I am currently using Woody snippets where it works fine but would like to move over to you guys. Below is the code, how do I fix this?
// Add alt tag to WordPress Gravatar images function bloggerpilot_gravatar_alt($bloggerpilotGravatar) { if (have_comments()) { $alt = get_comment_author(); } else { $alt = get_the_author_meta('display_name'); } $bloggerpilotGravatar = str_replace('alt=\'\'', 'alt=\'Avatar für ' . $alt . '\'', $bloggerpilotGravatar); return $bloggerpilotGravatar; } add_filter('get_avatar', 'bloggerpilot_gravatar_alt');
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Backslashes being removed from code snippets’ is closed to new replies.