Skip to content

Instantly share code, notes, and snippets.

@davisshaver
Last active August 29, 2015 14:25
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 davisshaver/4e465608869983c94907 to your computer and use it in GitHub Desktop.
Save davisshaver/4e465608869983c94907 to your computer and use it in GitHub Desktop.
Speed Bumps – Example code to accompany http://fus.in/1MidK1N
<?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