Possible problem with the is_preview() function
|Reported by:||theshaft||Owned by:||anonymous|
As I am no programmer, I'll provide info that produces the problem:
After, suggestion from people in the IRC channel, got it to work by editing the code in header.php file to the following:
When I edit:
- drafts: the js code is not executed
- published posts: the js code is executed
- private posts: the js code is executed
Steps to reproduce:
- Add the above sample code to the header.php file, inside the head HTML tags.
- Write a sample post and save it as a draft.
- The draft can be editited
- Publish the draft either as a private or public post
- Editing it is not possible, as the js code is executed and breaks the preview out of the frame
Seems that when editing drafts the is_preview() value is true, but when editing published posts the is_preview() value is false.