Created
July 21, 2015 14:19
-
-
Save davisshaver/f3e7757676a6c0cc0ed8 to your computer and use it in GitHub Desktop.
Speed Bumps – Example code
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