butlerblog
1/5/2016 - 1:33 AM

Use wpmem_securify to apply additional wrapper tags (useful with certain builder plugins)

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;
}