[wp-trac] [WordPress Trac] #25272: Refactor/clean up autosave and use heartbeat for transport

WordPress Trac noreply at wordpress.org
Thu Sep 26 05:09:28 UTC 2013


#25272: Refactor/clean up autosave and use heartbeat for transport
-------------------------+-----------------------
 Reporter:  azaozz       |       Owner:  azaozz
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  3.8
Component:  Autosave     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  early        |
-------------------------+-----------------------

Comment (by westonruter):

 @azaozz:

 In your latest patch, could you make the following tweak:

 {{{
 #!diff
 - $('form#post').attr('target', 'wp-preview').submit().attr('target', '');
 + $('form#post').attr('target',
 $(this).attr('target')).submit().attr('target', '');
 }}}

 Two reasons for this. First, it eliminates redundancy as the `wp-preview`
 target is already defined in `post_submit_meta_box()` as:

 {{{
 #!php
 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-
 preview" id="post-preview"><?php echo $preview_button; ?></a>
 }}}

 Secondly, I'm working on a plugin that manipulates the window target for
 the preview, and the only way to do so at the moment is to override the
 global `doPreview` function with one that uses the above change. But if
 the `#post-preview` click handler supplies the
 `$('form#post').attr('target')` from its own `target` attribute, then a
 plugin just has to manipulate the preview link/button `target` upon
 `jQuery.ready`.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25272#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list