Question about WP Function

Discussion in 'WordPress' started by Rory M, Jul 12, 2008.

  1. #1
    I am running an installation of WordPress MU and am writing a plugin that decides whether to show ads or not based on a value stored in that blogs database.

    function global_adsense($the_content) {
    
    	global $blog_id;
    
    	if(get_blog_option($blog_id, 'ads_removed') != "1")
    	{
    	$the_content .= '<!--ADS-->';
    
    	remove_filter('the_content', 'global_adsense'); // only for the first post
    }
    
    	return $the_content;
    	}
    PHP:
    The option 'ads_removed' is added on blog creation through the add_blog_option function.

    The ads are never displayed however :S

    Does anyone see a problem with the coding that I am missing?
     
    Rory M, Jul 12, 2008 IP