wp_post_revision_title [ WordPress Function ]
wp_post_revision_title ( $revision, $link = true )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: _wp_post_revision_fields, wp_is_post_revision, wp_get_post_revision, wp_get_post_revisions, wp_save_post_revision
Retrieve formatted date timestamp of a revision (linked to that revisions's page).
Source
<?php
function wp_post_revision_title( $revision, $link = true ) {
if ( !$revision = get_post( $revision ) )
return $revision;
if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
return false;
/* translators: revision date format, see http://php.net/date */
$datef = _x( 'j F, Y @ G:i', 'revision date format');
/* translators: 1: date */
$autosavef = __( '%1$s [Autosave]' );
/* translators: 1: date */
$currentf = __( '%1$s [Current Revision]' );
$date = date_i18n( $datef, strtotime( $revision->post_modified ) );
if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
$date = "<a href='$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;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- wp_post_revision_title (WordPress Function) - WPSeek.com
WordPress lookup for wp_post_revision_title, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Function Reference/register post type « WordPress Codex
translators: %s: date and time of the revision */ 5 => isset($_GET['revision']) ? sprintf( __('Book restored to revision from %s'), wp_post_revision_title( (int) ...
codex.wordpress.org - Docs for page post-template.php
string wp_post_revision_title (int|object $revision, [bool $link = true]). int|object $ revision: Revision ID or revision object. bool $link: Optional, default is true.
phpdoc.wordpress.org - /wp-includes/post-template.php source - PHP Cross Reference ...
Jun 1, 2011 ... 1267 */ 1268 function wp_post_revision_title( $revision, $link = true ) { 1269 if ( !$ revision = get_post( $revision ) ) 1270 return $revision; 1271 ...
xref.yoast.com