Last active
January 4, 2017 20:22
-
-
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)
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 | |
/** | |
* 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