Here’s the final fix, thanks to Jesper!
Replace this:
// integrate with editor
if (strstr($_SERVER[’PHP_SELF’], ‘post.php’) ||
with this:
// integrate with editor
if (strstr($_SERVER[’PHP_SELF’], ‘post-new.php’) ||
strstr($_SERVER[’PHP_SELF’], ‘page-new.php’)||
strstr($_SERVER[’PHP_SELF’], ‘post.php’)||
strstr($_SERVER[’PHP_SELF’], ‘page.php’))