How to update the modified date after using inline edit for custom fields

By default, the Post Modified date will not be updated when you use inline edit for custom field related columns. This is because of the default behaviour of WordPress that does not update a post when using the update_post_meta. In Admin Columns we chose to leave this as it, but with the following snippet you can update the post to update the post modified date.


Place the following code in your function.php.

 * Updates the post modified data after inline edit 
 * @param AC_Column $column Column instance
 * @param int $id Item ID
 * @param string $value User submitted input
function my_acp_after_ajax_column_save_update_post_date( $column, $id ) {
	if( 'post' === $column->get_list_screen()->get_meta_type() ){
		wp_update_post( array( 'ID' => $id ) );
add_action( 'acp/editing/saved', 'my_acp_after_ajax_column_save_update_post_date', 10, 2 );

This example will update the post for each post type. When using the wp_update_post function, the post modified date will also be updated.