| | 5485 | * Helper function for updating the post modified date. |
| | 5486 | * |
| | 5487 | * @since 4.1 |
| | 5488 | * |
| | 5489 | * @param int $post_id the ID of the Post object. |
| | 5490 | */ |
| | 5491 | function update_post_modified_date( $post_id ) { |
| | 5492 | $post_modified = current_time( 'mysql' ); |
| | 5493 | $post_modified_gmt = current_time( 'mysql', 1 ); |
| | 5494 | |
| | 5495 | $updated_fields = array( |
| | 5496 | 'post_modified' => $post_modified, |
| | 5497 | 'post_modified_gmt' => $post_modified_gmt |
| | 5498 | ); |
| | 5499 | $where = array( 'ID' => $post_id ); |
| | 5500 | |
| | 5501 | global $wpdb; |
| | 5502 | $wpdb->update( $wpdb->posts, $updated_fields, $where ); |
| | 5503 | |
| | 5504 | clean_post_cache( $post_id ); |
| | 5505 | } |
| | 5506 | |
| | 5507 | /** |