Fix compatibility issues with WordPress versions 3.0-3.2