Live Entry Preview Plugin for WP
May 29
Posted: under Technology.
I mentioned the other day that I missed the preview entry feature that MT has. It became even more apparent to me that it would be nice to have such a feature when I began to play with future-posting. If I wanted to “preview” my entry (look for far too frequent syntax/logic errors, that is), I had to actually post it, load the site, and then come back and edit the entry, adjusting the timestamp to reflect the time it should actually post at. This was kind of a pain.
At the same time, I manged to fall in love with the Live Comment Preview plugin that shows visitors what their comment will look like once posted, in real time. I put two and two together and decided it would be great to be able to have a live preview for entries.
So I modified the source of the plugin so that it would work with post editing instead. If you want to try it out, just download (use this link instead for the latest version) and then upload (be sure to remove the txt extension it has now) to /wp-content/plugins and activate it. (I didn’t even change the attributes for credits and such that you see in the plugin manager except for the name) Then all you need to do is add the line < ?php live_entry_preview(); ?> to /wp-admin/edit-form-advanced in the place that you’d like it to show up. (try right above the line that says < ?php _e('Advanced'); ?>).
And BTW, you must be using the advanced form for this to work. (This can be set under the options page) As it is right now, it is only setup to use the advanced editor and not the normal one.
Mind you, the code is pretty rough, as far as my modifications go. It works fine, but I’d clean it up before I’d do a whole lot with it.
more_link_text