shortcode fix again I hope for the <p></p> problem

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-12-24 07:51:05 -08:00
parent 7cf3aa4afc
commit d75c46345b
1 changed files with 4 additions and 4 deletions

View File

@ -48,13 +48,13 @@ function comicpress_members_filter($query) {
function shortcode_for_comicpress_members_only( $atts, $content = null ) { function shortcode_for_comicpress_members_only( $atts, $content = null ) {
global $post, $userdata, $profileuser, $current_user, $errormsg; global $post, $userdata, $profileuser, $current_user, $errormsg;
$returninfo = '<div class="non-member">'.__('There is Members Only content here.<br />To view this content you need to be a member of this site.','comicpress').'</div>'; $returninfo = '<div class="non-member"><p>'.__('There is Members Only content here.<br />To view this content you need to be a member of this site.','comicpress').'</p></div>';
if ( !empty($current_user->ID) ) { if ( !empty($current_user->ID) ) {
$is_member = get_usermeta($current_user->ID,'comicpress-is-member'); $is_member = get_usermeta($current_user->ID,'comicpress-is-member');
if ($is_member == 'yes' || current_user_can('publish_posts')) { if ($is_member == 'yes' || current_user_can('publish_posts')) {
$returninfo = "<div class=\"members-only\">$content</div>\r\n"; $content = str_replace('<p>', '', $content);
$returninfo = str_replace('<p>', '', $returninfo); $content = str_replace('</p>', '', $content);
$returninfo = str_replace('</p>', '', $returninfo); $returninfo = "<div class=\"members-only\">\r\n<p>$content</p>\r\n</div>\r\n";
} }
} }
return $returninfo; return $returninfo;