Skip to content

Instantly share code, notes, and snippets.

@butlerblog
Last active January 4, 2017 20:22
Show Gist options
  • Save butlerblog/39780ad8af98b5209ec7 to your computer and use it in GitHub Desktop.
Save butlerblog/39780ad8af98b5209ec7 to your computer and use it in GitHub Desktop.
Use wpmem_securify to apply additional wrapper tags (useful with certain builder plugins)
<?php
/**
* Example of wpmem_securify filter to add div wrappers
* to filtered content if user is not logged in.
*
* http://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_securify/
* https://developer.wordpress.org/reference/hooks/the_content/
*/
add_filter( 'wpmem_securify', 'my_securify_filter' );
function my_securify_filter( $content ) {
if ( ! is_user_logged_in() ) {
$content = '<div id="some_id">' . $content . '</div>';
}
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment