add a member variable to allow for custom flush functions

This differs from a Wordpress action in that it checks the return value from
the custom function, and if it's false, it doesn't attempt to flush.
Merge pull request #70 from kitwestneat/master

add a member variable to allow for custom flush functions