• The Hide This plugin (https://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.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Hide This – Easy Fix for 2.5?’ is closed to new replies.