Opened 19 years ago
Closed 18 years ago
#2200 closed enhancement (invalid)
Ability to hide preview
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | normal | Version: | 2.0 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
I really like the new preview feature in v2.0 but I don't always want to use it. Most of the time I don't need to look at it so it is just a waist of bandwidth and server power. I modified the \wp-admin\post.php file to allow me to view the preview only when I need it. It this is worth of inclusion in the trunk please feel free.
in wp-admin/post.php
Replace line 85 with
<script type="text/javascript"> <!-- function show_preview() { var elm = document.getElementById("frm_preview"); elm.src = "<?php the_permalink(); ?>" elm.height = "600" return false; } --> </script> <a href="#preview-post" onclick="show_preview();">Show Preview</a> <iframe id="frm_preview" src="" width="100%" height="10" ></iframe>
Attachments (3)
Change History (16)
#4
@
19 years ago
Sorry one more time. Some fancy quotes snuck in:
<script type="text/javascript"> <!-- function show_preview() { var elm = document.getElementById("frm_preview"); elm.src = "<?php the_permalink(); ?>" elm.height = "600" return false; } --> </script> <a href="#preview-post" onclick="show_preview();">Show Preview</a> <iframe id="frm_preview" src="" width="100%" height="10" ></iframe>
#6
@
19 years ago
Patch created from $wp_version = '2.0.1'; $wp_db_version = 3437;. Was actually at line 83 of my post.php instead of line 85 as noted by hypercubed.
#7
@
19 years ago
WordPress 2.0.1 changed the preview link. The fifth line in my hack should now be:
elm.src = "<?php echo add_query_arg('preview', 'true', get_permalink($post->ID)); ?>";
#8
@
19 years ago
- Keywords 2nd-opinion has-patch added; bg|2nd-opinion bg|has-patch removed
-1 on this. I use the preview window a lot and I wouldn't like the extra click this imposes on me.
#11
@
18 years ago
It is now line 72 replaced with:
<script type="text/javascript"> <!-- function show_preview() { var elm = document.getElementById("frm_preview"); elm.src = "<?php echo attribute_escape(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>"; elm.height = "600"; return false; } --> </script> <a href="#preview-post" onclick="show_preview();">Show Preview</a> <iframe id="frm_preview" src="" width="100%" height="10" ></iframe>
I was missing a couple of semicolons in the javascript: