• Resolved ecdltf

    (@ecdltf)


    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

    https://wordpress.org/plugins/stealth-update/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ecdltf

    (@ecdltf)

    Now a couple of weeks has passed, I’m still using your plugin with my hack (see above) and still everything is working fine. Checkboxes work as expected, in QuickEdit as in normal mode.

    Any chances that you’ll implement it (or something equivalent) to your nice plugin?

    Thread Starter ecdltf

    (@ecdltf)

    @ the author: Are you still maintaining the plugin?

    Thread Starter ecdltf

    (@ecdltf)

    Thanks for the update 🙂

    Tom

    Plugin Author Scott Reilly

    (@coffee2code)

    WordPress & Plugin Developer

    @ecdltf: Hi Tom,

    Thanks for the contribution! 🙂 I meant to circle back and follow-up with this thread after the plugin’s latest release, so I’m glad you noticed the update.

    For anyone else seeing this later, support for the quick edit box was added in v2.5 of the plugin.

    Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘QuickEdit UI’ is closed to new replies.