Last active
August 29, 2015 14:25
-
-
Save davisshaver/4e465608869983c94907 to your computer and use it in GitHub Desktop.
Speed Bumps – Example code to accompany http://fus.in/1MidK1N
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 | |
register_speed_bump( 'rickroll', array( | |
'string_to_inject' => function() { return '<iframe width="420" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>'; }, | |
'minimum_content_length' => false, | |
'from_start' => false, | |
'from_end' => false, | |
)); | |
add_filter( 'the_content', 'insert_speed_bumps', 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment