Ticket #5196: minoredithooks.patch

File minoredithooks.patch, 1.1 KB (added by CiaranG, 4 years ago)

Patch that adds two hooks to facilitate a "minor edits" plugin

  • wp-includes/post.php

     
    13691369        } 
    13701370 
    13711371        if ( $update || '0000-00-00 00:00:00' == $post_date ) { 
    1372                 $post_modified     = current_time( 'mysql' ); 
    1373                 $post_modified_gmt = current_time( 'mysql', 1 ); 
     1372                if(apply_filters('update_modified',true,$postarr)) { 
     1373                        $post_modified     = current_time( 'mysql' ); 
     1374                        $post_modified_gmt = current_time( 'mysql', 1 ); 
     1375                } 
    13741376        } else { 
    13751377                $post_modified     = $post_date; 
    13761378                $post_modified_gmt = $post_date_gmt; 
  • wp-admin/edit-form-advanced.php

     
    154154</div> 
    155155 
    156156<p class="submit"> 
     157<?php do_action('editpost_presave',$post) ?> 
    157158<input type="submit" name="save" id="save-post" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" /> 
    158159<?php 
    159160if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post_ID ) {