Save tags lingering in quick add box upon save. Props fitzrev. fixes #5849
git-svn-id: http://svn.automattic.com/wordpress/trunk@6834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
968682dea6
commit
3453246f35
|
@ -146,7 +146,7 @@ if ( 'future' == $post->post_status ) {
|
|||
</div>
|
||||
|
||||
<p class="submit">
|
||||
<input type="submit" name="save" value="<?php _e('Save'); ?>" style="font-weight: bold;" tabindex="4" />
|
||||
<input type="submit" name="save" id="save-post" value="<?php _e('Save'); ?>" style="font-weight: bold;" tabindex="4" />
|
||||
<?php
|
||||
if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post_ID ) {
|
||||
?>
|
||||
|
|
|
@ -45,6 +45,11 @@ function tag_flush_to_text() {
|
|||
return false;
|
||||
}
|
||||
|
||||
function tag_save_on_publish() {
|
||||
if ( jQuery('#newtag').val() != postL10n.addTag )
|
||||
tag_flush_to_text();
|
||||
}
|
||||
|
||||
function tag_press_key( e ) {
|
||||
if ( 13 == e.keyCode ) {
|
||||
tag_flush_to_text();
|
||||
|
@ -78,6 +83,10 @@ addLoadEvent( function() {
|
|||
jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' );
|
||||
});
|
||||
|
||||
// auto-save tags on post save/publish
|
||||
jQuery('#publish').click( tag_save_on_publish );
|
||||
jQuery('#save-post').click( tag_save_on_publish );
|
||||
|
||||
// auto-suggest stuff
|
||||
jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2 } );
|
||||
jQuery('#newtag').keypress( tag_press_key );
|
||||
|
|
Loading…
Reference in New Issue