QuickEdit UI
-
I started to restructure the category and tag assignment of my posts when I noticed that —to my horror— WP was f…ing up the modified dates of all concerned posts.
Since I’ve done this from the QuickEdit UI, I also noticed that Stealth Update isn’t available there.
In the other thread I read that you are planning to reintroduce the checkbox in the QuickEdit at a later time.
This post is to encourage you to do this as soon as you find the time ??
I hacked around a bit in the code of your plugin, and it seems I found a working solution.
In case it helps, here is a patch against version 2.4.2 of your
stealth-update.php
:--- /Users/tom/Downloads/stealth-update/stealth-update.php 2015-02-22 07:33:06.000000000 +0100 +++ /Users/tom/Downloads/stealth-update-242-mod/stealth-update.php 2015-11-14 01:35:43.000000000 +0100 @@ -113,6 +113,7 @@ * @uses apply_filters() Calls 'c2c_stealth_update_default' with stealth publish state default (false) */ public static function add_ui() { + if ( did_action( 'quick_edit_custom_box' ) > 1 ) return; global $post; if ( apply_filters( 'c2c_stealth_update_default', false, $post ) ) { @@ -125,7 +126,6 @@ echo "<div class='misc-pub-section'><label class='selectit c2c-stealth-update' for='" . self::$field . "' title='"; esc_attr_e( 'If checked, the post\'s modification date won\'t be updated to reflect the update when the post is saved.', 'stealth-update' ); echo "'>\n"; - echo "<input type='hidden' name='" . self::$prev_field . "' value='" . esc_attr( $post->post_modified ) . "' />\n"; echo "<input id='" . self::$field . "' type='checkbox' $checked value='1' name='" . self::$field . "' />\n"; _e( 'Stealth update?', 'stealth-update' ); echo '</label></div>' . "\n"; @@ -147,8 +147,8 @@ update_post_meta( $postarr['ID'], self::$meta_key, $new_value ); // Possibly revert the post_modified date to the previous post_modified date - if ( isset( $postarr[ self::$field ] ) && $postarr[ self::$field ] && isset( $postarr[ self::$prev_field ] ) ) { - $data['post_modified'] = $postarr[ self::$prev_field ]; + if ( isset ( $postarr[ self::$field ] ) ) { + $data['post_modified'] = $postarr['post_modified']; $data['post_modified_gmt'] = get_gmt_from_date( $data['post_modified'] ); } }
- The checkbox is available again in QuickEdit, without duplicate boxes
- If the box is checked the old modified date of the post in question is correctly preserved
- In the full post edit screen it is still functional, too
I tested it with a couple of post modifications and so far it seems to work fine. But it’s a hack, so no guarantees…
Thanks for this very useful plugin!
Tom
- The topic ‘QuickEdit UI’ is closed to new replies.