WordPress.org

Ready to get started?Download WordPress

Forums

Hide This - Easy Fix for 2.5? (2 posts)

  1. mroussell
    Member
    Posted 5 years ago #

    The Hide This plugin (http://edwards.org/2006/03/12/hidethis-v10-plugin-for-wordpress) does exactly what i need but it doesn't seem to work with 2.5

    The code is pretty simple (<20 lines) and I'm wondering if there is a quick fix to get it to work in 2.5

    add_filter('the_content', 'hide_some_content');
    
    function hide_some_content($content) {
    global $current_user, $user_ID;
    
    if (($current_user->id == 0) && ($user_ID == 0)){
    
    	$b = strpos($content, '<!--hidethis-->');
    	$e = strpos($content, '<!--/hidethis-->');
    
    	$pre = substr($content,0,$b);
    	$suf .= substr($content,$e,strlen($content));
    
    	return $pre.$suf;
    
    } else { return $content; }
    
    }

    Thanks in advance.

  2. mroussell
    Member
    Posted 5 years ago #

    Any help?

Topic Closed

This topic has been closed to new replies.

About this Topic