Title: wp_post_revision_title
Published: April 25, 2014
Last modified: August 20, 2026

---

# wp_post_revision_title( int|WP_Post $revision, bool $link = true ): string|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#wp--skip-link--target)

Retrieves formatted date timestamp of a revision (linked to that revisions’s page).

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#parameters)󠁿

 `$revision`int|[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)
required

Revision ID or revision object.

`$link`booloptional

Whether to link to revision’s page.

Default:`true`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#return)󠁿

 string|false i18n formatted datetimestamp or localized ‘Current Revision’.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#source)󠁿

    ```php
    function wp_post_revision_title( $revision, $link = true ) {
    	$revision = get_post( $revision );

    	if ( ! $revision ) {
    		return $revision;
    	}

    	if ( ! in_array( $revision->post_type, array( 'post', 'page', 'revision' ), true ) ) {
    		return false;
    	}

    	/* translators: Revision date format, see https://www.php.net/manual/datetime.format.php */
    	$datef = _x( 'F j, Y @ H:i:s', 'revision date format' );
    	/* translators: %s: Revision date. */
    	$autosavef = __( '%s [Autosave]' );
    	/* translators: %s: Revision date. */
    	$currentf = __( '%s [Current Revision]' );

    	$date      = date_i18n( $datef, strtotime( $revision->post_modified ) );
    	$edit_link = get_edit_post_link( $revision->ID );
    	if ( $link && current_user_can( 'edit_post', $revision->ID ) && $edit_link ) {
    		$date = "<a href='$edit_link'>$date</a>";
    	}

    	if ( ! wp_is_post_revision( $revision ) ) {
    		$date = sprintf( $currentf, $date );
    	} elseif ( wp_is_post_autosave( $revision ) ) {
    		$date = sprintf( $autosavef, $date );
    	}

    	return $date;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/post-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/post-template.php#L1929)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/post-template.php#L1929-L1960)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#related)󠁿

| Uses | Description | 
| [date_i18n()](https://developer.wordpress.org/reference/functions/date_i18n/)`wp-includes/functions.php` |

Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds.

  | 
| [get_edit_post_link()](https://developer.wordpress.org/reference/functions/get_edit_post_link/)`wp-includes/link-template.php` |

Retrieves the edit post link for post.

  | 
| [wp_is_post_autosave()](https://developer.wordpress.org/reference/functions/wp_is_post_autosave/)`wp-includes/revision.php` |

Determines if the specified post is an autosave.

  | 
| [wp_is_post_revision()](https://developer.wordpress.org/reference/functions/wp_is_post_revision/)`wp-includes/revision.php` |

Determines if the specified post is a revision.

  | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [get_post()](https://developer.wordpress.org/reference/functions/get_post/)`wp-includes/post.php` |

Retrieves post data given a post ID or post object.

  |

[Show 4 more](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_post_revision_title/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.6.0](https://developer.wordpress.org/reference/since/2.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_post_revision_title%2F)
before being able to contribute a note or feedback.