Skip to content

Instantly share code, notes, and snippets.

@westonruter
Last active May 10, 2020 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westonruter/f451337351e803044413d942f307229b to your computer and use it in GitHub Desktop.
Save westonruter/f451337351e803044413d942f307229b to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Bad Hooks
* Description: Action and filter which add bad markup.
* Version: 0.1
* Plugin URI: https://gist.github.com/westonruter/f451337351e803044413d942f307229b
* Author: Weston Ruter
*/
namespace Bad\Hooks;
\add_action(
'wp_footer',
function () {
echo '<script>document.write("Bad action!!!");</script><noscript>Bad action!</noscript>';
}
);
\add_filter(
'the_content',
function ( $content ) {
return $content . '<script>document.write("Bad filter!!!");</script><noscript>Bad filter!</noscript>';
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment