Edit File by line
/home/barbar84/public_h.../wp-admin/includes
File: revision.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordPress Administration Revisions API
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
* @since 3.6.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Get the revision UI diff.
[10] Fix | Delete
*
[11] Fix | Delete
* @since 3.6.0
[12] Fix | Delete
*
[13] Fix | Delete
* @param WP_Post|int $post The post object or post ID.
[14] Fix | Delete
* @param int $compare_from The revision ID to compare from.
[15] Fix | Delete
* @param int $compare_to The revision ID to come to.
[16] Fix | Delete
* @return array|false Associative array of a post's revisioned fields and their diffs.
[17] Fix | Delete
* Or, false on failure.
[18] Fix | Delete
*/
[19] Fix | Delete
function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
[20] Fix | Delete
$post = get_post( $post );
[21] Fix | Delete
if ( ! $post ) {
[22] Fix | Delete
return false;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
if ( $compare_from ) {
[26] Fix | Delete
$compare_from = get_post( $compare_from );
[27] Fix | Delete
if ( ! $compare_from ) {
[28] Fix | Delete
return false;
[29] Fix | Delete
}
[30] Fix | Delete
} else {
[31] Fix | Delete
// If we're dealing with the first revision...
[32] Fix | Delete
$compare_from = false;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
$compare_to = get_post( $compare_to );
[36] Fix | Delete
if ( ! $compare_to ) {
[37] Fix | Delete
return false;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
// If comparing revisions, make sure we're dealing with the right post parent.
[41] Fix | Delete
// The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves.
[42] Fix | Delete
if ( $compare_from && $compare_from->post_parent !== $post->ID && $compare_from->ID !== $post->ID ) {
[43] Fix | Delete
return false;
[44] Fix | Delete
}
[45] Fix | Delete
if ( $compare_to->post_parent !== $post->ID && $compare_to->ID !== $post->ID ) {
[46] Fix | Delete
return false;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
if ( $compare_from && strtotime( $compare_from->post_date_gmt ) > strtotime( $compare_to->post_date_gmt ) ) {
[50] Fix | Delete
$temp = $compare_from;
[51] Fix | Delete
$compare_from = $compare_to;
[52] Fix | Delete
$compare_to = $temp;
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
// Add default title if title field is empty.
[56] Fix | Delete
if ( $compare_from && empty( $compare_from->post_title ) ) {
[57] Fix | Delete
$compare_from->post_title = __( '(no title)' );
[58] Fix | Delete
}
[59] Fix | Delete
if ( empty( $compare_to->post_title ) ) {
[60] Fix | Delete
$compare_to->post_title = __( '(no title)' );
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
$return = array();
[64] Fix | Delete
[65] Fix | Delete
foreach ( _wp_post_revision_fields( $post ) as $field => $name ) {
[66] Fix | Delete
/**
[67] Fix | Delete
* Contextually filter a post revision field.
[68] Fix | Delete
*
[69] Fix | Delete
* The dynamic portion of the hook name, `$field`, corresponds to each of the post
[70] Fix | Delete
* fields of the revision object being iterated over in a foreach statement.
[71] Fix | Delete
*
[72] Fix | Delete
* @since 3.6.0
[73] Fix | Delete
*
[74] Fix | Delete
* @param string $revision_field The current revision field to compare to or from.
[75] Fix | Delete
* @param string $field The current revision field.
[76] Fix | Delete
* @param WP_Post $compare_from The revision post object to compare to or from.
[77] Fix | Delete
* @param string $context The context of whether the current revision is the old
[78] Fix | Delete
* or the new one. Values are 'to' or 'from'.
[79] Fix | Delete
*/
[80] Fix | Delete
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';
[81] Fix | Delete
[82] Fix | Delete
/** This filter is documented in wp-admin/includes/revision.php */
[83] Fix | Delete
$content_to = apply_filters( "_wp_post_revision_field_{$field}", $compare_to->$field, $field, $compare_to, 'to' );
[84] Fix | Delete
[85] Fix | Delete
$args = array(
[86] Fix | Delete
'show_split_view' => true,
[87] Fix | Delete
'title_left' => __( 'Removed' ),
[88] Fix | Delete
'title_right' => __( 'Added' ),
[89] Fix | Delete
);
[90] Fix | Delete
[91] Fix | Delete
/**
[92] Fix | Delete
* Filters revisions text diff options.
[93] Fix | Delete
*
[94] Fix | Delete
* Filters the options passed to wp_text_diff() when viewing a post revision.
[95] Fix | Delete
*
[96] Fix | Delete
* @since 4.1.0
[97] Fix | Delete
*
[98] Fix | Delete
* @param array $args {
[99] Fix | Delete
* Associative array of options to pass to wp_text_diff().
[100] Fix | Delete
*
[101] Fix | Delete
* @type bool $show_split_view True for split view (two columns), false for
[102] Fix | Delete
* un-split view (single column). Default true.
[103] Fix | Delete
* }
[104] Fix | Delete
* @param string $field The current revision field.
[105] Fix | Delete
* @param WP_Post $compare_from The revision post to compare from.
[106] Fix | Delete
* @param WP_Post $compare_to The revision post to compare to.
[107] Fix | Delete
*/
[108] Fix | Delete
$args = apply_filters( 'revision_text_diff_options', $args, $field, $compare_from, $compare_to );
[109] Fix | Delete
[110] Fix | Delete
$diff = wp_text_diff( $content_from, $content_to, $args );
[111] Fix | Delete
[112] Fix | Delete
if ( ! $diff && 'post_title' === $field ) {
[113] Fix | Delete
// It's a better user experience to still show the Title, even if it didn't change.
[114] Fix | Delete
// No, you didn't see this.
[115] Fix | Delete
$diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
[116] Fix | Delete
[117] Fix | Delete
// In split screen mode, show the title before/after side by side.
[118] Fix | Delete
if ( true === $args['show_split_view'] ) {
[119] Fix | Delete
$diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td><td></td><td>' . esc_html( $compare_to->post_title ) . '</td>';
[120] Fix | Delete
} else {
[121] Fix | Delete
$diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td>';
[122] Fix | Delete
[123] Fix | Delete
// In single column mode, only show the title once if unchanged.
[124] Fix | Delete
if ( $compare_from->post_title !== $compare_to->post_title ) {
[125] Fix | Delete
$diff .= '</tr><tr><td>' . esc_html( $compare_to->post_title ) . '</td>';
[126] Fix | Delete
}
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
$diff .= '</tr></tbody>';
[130] Fix | Delete
$diff .= '</table>';
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
if ( $diff ) {
[134] Fix | Delete
$return[] = array(
[135] Fix | Delete
'id' => $field,
[136] Fix | Delete
'name' => $name,
[137] Fix | Delete
'diff' => $diff,
[138] Fix | Delete
);
[139] Fix | Delete
}
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
/**
[143] Fix | Delete
* Filters the fields displayed in the post revision diff UI.
[144] Fix | Delete
*
[145] Fix | Delete
* @since 4.1.0
[146] Fix | Delete
*
[147] Fix | Delete
* @param array[] $return Array of revision UI fields. Each item is an array of id, name, and diff.
[148] Fix | Delete
* @param WP_Post $compare_from The revision post to compare from.
[149] Fix | Delete
* @param WP_Post $compare_to The revision post to compare to.
[150] Fix | Delete
*/
[151] Fix | Delete
return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );
[152] Fix | Delete
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
/**
[156] Fix | Delete
* Prepare revisions for JavaScript.
[157] Fix | Delete
*
[158] Fix | Delete
* @since 3.6.0
[159] Fix | Delete
*
[160] Fix | Delete
* @param WP_Post|int $post The post object or post ID.
[161] Fix | Delete
* @param int $selected_revision_id The selected revision ID.
[162] Fix | Delete
* @param int $from Optional. The revision ID to compare from.
[163] Fix | Delete
* @return array An associative array of revision data and related settings.
[164] Fix | Delete
*/
[165] Fix | Delete
function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) {
[166] Fix | Delete
$post = get_post( $post );
[167] Fix | Delete
$authors = array();
[168] Fix | Delete
$now_gmt = time();
[169] Fix | Delete
[170] Fix | Delete
$revisions = wp_get_post_revisions(
[171] Fix | Delete
$post->ID,
[172] Fix | Delete
array(
[173] Fix | Delete
'order' => 'ASC',
[174] Fix | Delete
'check_enabled' => false,
[175] Fix | Delete
)
[176] Fix | Delete
);
[177] Fix | Delete
// If revisions are disabled, we only want autosaves and the current post.
[178] Fix | Delete
if ( ! wp_revisions_enabled( $post ) ) {
[179] Fix | Delete
foreach ( $revisions as $revision_id => $revision ) {
[180] Fix | Delete
if ( ! wp_is_post_autosave( $revision ) ) {
[181] Fix | Delete
unset( $revisions[ $revision_id ] );
[182] Fix | Delete
}
[183] Fix | Delete
}
[184] Fix | Delete
$revisions = array( $post->ID => $post ) + $revisions;
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
$show_avatars = get_option( 'show_avatars' );
[188] Fix | Delete
[189] Fix | Delete
cache_users( wp_list_pluck( $revisions, 'post_author' ) );
[190] Fix | Delete
[191] Fix | Delete
$can_restore = current_user_can( 'edit_post', $post->ID );
[192] Fix | Delete
$current_id = false;
[193] Fix | Delete
[194] Fix | Delete
foreach ( $revisions as $revision ) {
[195] Fix | Delete
$modified = strtotime( $revision->post_modified );
[196] Fix | Delete
$modified_gmt = strtotime( $revision->post_modified_gmt . ' +0000' );
[197] Fix | Delete
if ( $can_restore ) {
[198] Fix | Delete
$restore_link = str_replace(
[199] Fix | Delete
'&amp;',
[200] Fix | Delete
'&',
[201] Fix | Delete
wp_nonce_url(
[202] Fix | Delete
add_query_arg(
[203] Fix | Delete
array(
[204] Fix | Delete
'revision' => $revision->ID,
[205] Fix | Delete
'action' => 'restore',
[206] Fix | Delete
),
[207] Fix | Delete
admin_url( 'revision.php' )
[208] Fix | Delete
),
[209] Fix | Delete
"restore-post_{$revision->ID}"
[210] Fix | Delete
)
[211] Fix | Delete
);
[212] Fix | Delete
}
[213] Fix | Delete
[214] Fix | Delete
if ( ! isset( $authors[ $revision->post_author ] ) ) {
[215] Fix | Delete
$authors[ $revision->post_author ] = array(
[216] Fix | Delete
'id' => (int) $revision->post_author,
[217] Fix | Delete
'avatar' => $show_avatars ? get_avatar( $revision->post_author, 32 ) : '',
[218] Fix | Delete
'name' => get_the_author_meta( 'display_name', $revision->post_author ),
[219] Fix | Delete
);
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
$autosave = (bool) wp_is_post_autosave( $revision );
[223] Fix | Delete
$current = ! $autosave && $revision->post_modified_gmt === $post->post_modified_gmt;
[224] Fix | Delete
if ( $current && ! empty( $current_id ) ) {
[225] Fix | Delete
// If multiple revisions have the same post_modified_gmt, highest ID is current.
[226] Fix | Delete
if ( $current_id < $revision->ID ) {
[227] Fix | Delete
$revisions[ $current_id ]['current'] = false;
[228] Fix | Delete
$current_id = $revision->ID;
[229] Fix | Delete
} else {
[230] Fix | Delete
$current = false;
[231] Fix | Delete
}
[232] Fix | Delete
} elseif ( $current ) {
[233] Fix | Delete
$current_id = $revision->ID;
[234] Fix | Delete
}
[235] Fix | Delete
[236] Fix | Delete
$revisions_data = array(
[237] Fix | Delete
'id' => $revision->ID,
[238] Fix | Delete
'title' => get_the_title( $post->ID ),
[239] Fix | Delete
'author' => $authors[ $revision->post_author ],
[240] Fix | Delete
'date' => date_i18n( __( 'M j, Y @ H:i' ), $modified ),
[241] Fix | Delete
'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), $modified ),
[242] Fix | Delete
/* translators: %s: Human-readable time difference. */
[243] Fix | Delete
'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ),
[244] Fix | Delete
'autosave' => $autosave,
[245] Fix | Delete
'current' => $current,
[246] Fix | Delete
'restoreUrl' => $can_restore ? $restore_link : false,
[247] Fix | Delete
);
[248] Fix | Delete
[249] Fix | Delete
/**
[250] Fix | Delete
* Filters the array of revisions used on the revisions screen.
[251] Fix | Delete
*
[252] Fix | Delete
* @since 4.4.0
[253] Fix | Delete
*
[254] Fix | Delete
* @param array $revisions_data {
[255] Fix | Delete
* The bootstrapped data for the revisions screen.
[256] Fix | Delete
*
[257] Fix | Delete
* @type int $id Revision ID.
[258] Fix | Delete
* @type string $title Title for the revision's parent WP_Post object.
[259] Fix | Delete
* @type int $author Revision post author ID.
[260] Fix | Delete
* @type string $date Date the revision was modified.
[261] Fix | Delete
* @type string $dateShort Short-form version of the date the revision was modified.
[262] Fix | Delete
* @type string $timeAgo GMT-aware amount of time ago the revision was modified.
[263] Fix | Delete
* @type bool $autosave Whether the revision is an autosave.
[264] Fix | Delete
* @type bool $current Whether the revision is both not an autosave and the post
[265] Fix | Delete
* modified date matches the revision modified date (GMT-aware).
[266] Fix | Delete
* @type bool|false $restoreUrl URL if the revision can be restored, false otherwise.
[267] Fix | Delete
* }
[268] Fix | Delete
* @param WP_Post $revision The revision's WP_Post object.
[269] Fix | Delete
* @param WP_Post $post The revision's parent WP_Post object.
[270] Fix | Delete
*/
[271] Fix | Delete
$revisions[ $revision->ID ] = apply_filters( 'wp_prepare_revision_for_js', $revisions_data, $revision, $post );
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
/**
[275] Fix | Delete
* If we only have one revision, the initial revision is missing; This happens
[276] Fix | Delete
* when we have an autsosave and the user has clicked 'View the Autosave'
[277] Fix | Delete
*/
[278] Fix | Delete
if ( 1 === count( $revisions ) ) {
[279] Fix | Delete
$revisions[ $post->ID ] = array(
[280] Fix | Delete
'id' => $post->ID,
[281] Fix | Delete
'title' => get_the_title( $post->ID ),
[282] Fix | Delete
'author' => $authors[ $revision->post_author ],
[283] Fix | Delete
'date' => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),
[284] Fix | Delete
'dateShort' => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),
[285] Fix | Delete
/* translators: %s: Human-readable time difference. */
[286] Fix | Delete
'timeAgo' => sprintf( __( '%s ago' ), human_time_diff( strtotime( $post->post_modified_gmt ), $now_gmt ) ),
[287] Fix | Delete
'autosave' => false,
[288] Fix | Delete
'current' => true,
[289] Fix | Delete
'restoreUrl' => false,
[290] Fix | Delete
);
[291] Fix | Delete
$current_id = $post->ID;
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
/*
[295] Fix | Delete
* If a post has been saved since the last revision (no revisioned fields
[296] Fix | Delete
* were changed), we may not have a "current" revision. Mark the latest
[297] Fix | Delete
* revision as "current".
[298] Fix | Delete
*/
[299] Fix | Delete
if ( empty( $current_id ) ) {
[300] Fix | Delete
if ( $revisions[ $revision->ID ]['autosave'] ) {
[301] Fix | Delete
$revision = end( $revisions );
[302] Fix | Delete
while ( $revision['autosave'] ) {
[303] Fix | Delete
$revision = prev( $revisions );
[304] Fix | Delete
}
[305] Fix | Delete
$current_id = $revision['id'];
[306] Fix | Delete
} else {
[307] Fix | Delete
$current_id = $revision->ID;
[308] Fix | Delete
}
[309] Fix | Delete
$revisions[ $current_id ]['current'] = true;
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
// Now, grab the initial diff.
[313] Fix | Delete
$compare_two_mode = is_numeric( $from );
[314] Fix | Delete
if ( ! $compare_two_mode ) {
[315] Fix | Delete
$found = array_search( $selected_revision_id, array_keys( $revisions ), true );
[316] Fix | Delete
if ( $found ) {
[317] Fix | Delete
$from = array_keys( array_slice( $revisions, $found - 1, 1, true ) );
[318] Fix | Delete
$from = reset( $from );
[319] Fix | Delete
} else {
[320] Fix | Delete
$from = 0;
[321] Fix | Delete
}
[322] Fix | Delete
}
[323] Fix | Delete
[324] Fix | Delete
$from = absint( $from );
[325] Fix | Delete
[326] Fix | Delete
$diffs = array(
[327] Fix | Delete
array(
[328] Fix | Delete
'id' => $from . ':' . $selected_revision_id,
[329] Fix | Delete
'fields' => wp_get_revision_ui_diff( $post->ID, $from, $selected_revision_id ),
[330] Fix | Delete
),
[331] Fix | Delete
);
[332] Fix | Delete
[333] Fix | Delete
return array(
[334] Fix | Delete
'postId' => $post->ID,
[335] Fix | Delete
'nonce' => wp_create_nonce( 'revisions-ajax-nonce' ),
[336] Fix | Delete
'revisionData' => array_values( $revisions ),
[337] Fix | Delete
'to' => $selected_revision_id,
[338] Fix | Delete
'from' => $from,
[339] Fix | Delete
'diffData' => $diffs,
[340] Fix | Delete
'baseUrl' => parse_url( admin_url( 'revision.php' ), PHP_URL_PATH ),
[341] Fix | Delete
'compareTwoMode' => absint( $compare_two_mode ), // Apparently booleans are not allowed.
[342] Fix | Delete
'revisionIds' => array_keys( $revisions ),
[343] Fix | Delete
);
[344] Fix | Delete
}
[345] Fix | Delete
[346] Fix | Delete
/**
[347] Fix | Delete
* Print JavaScript templates required for the revisions experience.
[348] Fix | Delete
*
[349] Fix | Delete
* @since 4.1.0
[350] Fix | Delete
*
[351] Fix | Delete
* @global WP_Post $post Global post object.
[352] Fix | Delete
*/
[353] Fix | Delete
function wp_print_revision_templates() {
[354] Fix | Delete
global $post;
[355] Fix | Delete
?><script id="tmpl-revisions-frame" type="text/html">
[356] Fix | Delete
<div class="revisions-control-frame"></div>
[357] Fix | Delete
<div class="revisions-diff-frame"></div>
[358] Fix | Delete
</script>
[359] Fix | Delete
[360] Fix | Delete
<script id="tmpl-revisions-buttons" type="text/html">
[361] Fix | Delete
<div class="revisions-previous">
[362] Fix | Delete
<input class="button" type="button" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
[363] Fix | Delete
</div>
[364] Fix | Delete
[365] Fix | Delete
<div class="revisions-next">
[366] Fix | Delete
<input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
[367] Fix | Delete
</div>
[368] Fix | Delete
</script>
[369] Fix | Delete
[370] Fix | Delete
<script id="tmpl-revisions-checkbox" type="text/html">
[371] Fix | Delete
<div class="revision-toggle-compare-mode">
[372] Fix | Delete
<label>
[373] Fix | Delete
<input type="checkbox" class="compare-two-revisions"
[374] Fix | Delete
<#
[375] Fix | Delete
if ( 'undefined' !== typeof data && data.model.attributes.compareTwoMode ) {
[376] Fix | Delete
#> checked="checked"<#
[377] Fix | Delete
}
[378] Fix | Delete
#>
[379] Fix | Delete
/>
[380] Fix | Delete
<?php esc_html_e( 'Compare any two revisions' ); ?>
[381] Fix | Delete
</label>
[382] Fix | Delete
</div>
[383] Fix | Delete
</script>
[384] Fix | Delete
[385] Fix | Delete
<script id="tmpl-revisions-meta" type="text/html">
[386] Fix | Delete
<# if ( ! _.isUndefined( data.attributes ) ) { #>
[387] Fix | Delete
<div class="diff-title">
[388] Fix | Delete
<# if ( 'from' === data.type ) { #>
[389] Fix | Delete
<strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
[390] Fix | Delete
<# } else if ( 'to' === data.type ) { #>
[391] Fix | Delete
<strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
[392] Fix | Delete
<# } #>
[393] Fix | Delete
<div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
[394] Fix | Delete
{{{ data.attributes.author.avatar }}}
[395] Fix | Delete
<div class="author-info">
[396] Fix | Delete
<# if ( data.attributes.autosave ) { #>
[397] Fix | Delete
<span class="byline">
[398] Fix | Delete
<?php
[399] Fix | Delete
printf(
[400] Fix | Delete
/* translators: %s: User's display name. */
[401] Fix | Delete
__( 'Autosave by %s' ),
[402] Fix | Delete
'<span class="author-name">{{ data.attributes.author.name }}</span>'
[403] Fix | Delete
);
[404] Fix | Delete
?>
[405] Fix | Delete
</span>
[406] Fix | Delete
<# } else if ( data.attributes.current ) { #>
[407] Fix | Delete
<span class="byline">
[408] Fix | Delete
<?php
[409] Fix | Delete
printf(
[410] Fix | Delete
/* translators: %s: User's display name. */
[411] Fix | Delete
__( 'Current Revision by %s' ),
[412] Fix | Delete
'<span class="author-name">{{ data.attributes.author.name }}</span>'
[413] Fix | Delete
);
[414] Fix | Delete
?>
[415] Fix | Delete
</span>
[416] Fix | Delete
<# } else { #>
[417] Fix | Delete
<span class="byline">
[418] Fix | Delete
<?php
[419] Fix | Delete
printf(
[420] Fix | Delete
/* translators: %s: User's display name. */
[421] Fix | Delete
__( 'Revision by %s' ),
[422] Fix | Delete
'<span class="author-name">{{ data.attributes.author.name }}</span>'
[423] Fix | Delete
);
[424] Fix | Delete
?>
[425] Fix | Delete
</span>
[426] Fix | Delete
<# } #>
[427] Fix | Delete
<span class="time-ago">{{ data.attributes.timeAgo }}</span>
[428] Fix | Delete
<span class="date">({{ data.attributes.dateShort }})</span>
[429] Fix | Delete
</div>
[430] Fix | Delete
<# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
[431] Fix | Delete
<input <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
[432] Fix | Delete
disabled="disabled"
[433] Fix | Delete
<?php } else { ?>
[434] Fix | Delete
<# if ( data.attributes.current ) { #>
[435] Fix | Delete
disabled="disabled"
[436] Fix | Delete
<# } #>
[437] Fix | Delete
<?php } ?>
[438] Fix | Delete
<# if ( data.attributes.autosave ) { #>
[439] Fix | Delete
type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Autosave' ); ?>" />
[440] Fix | Delete
<# } else { #>
[441] Fix | Delete
type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Revision' ); ?>" />
[442] Fix | Delete
<# } #>
[443] Fix | Delete
<# } #>
[444] Fix | Delete
</div>
[445] Fix | Delete
<# if ( 'tooltip' === data.type ) { #>
[446] Fix | Delete
<div class="revisions-tooltip-arrow"><span></span></div>
[447] Fix | Delete
<# } #>
[448] Fix | Delete
<# } #>
[449] Fix | Delete
</script>
[450] Fix | Delete
[451] Fix | Delete
<script id="tmpl-revisions-diff" type="text/html">
[452] Fix | Delete
<div class="loading-indicator"><span class="spinner"></span></div>
[453] Fix | Delete
<div class="diff-error"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>
[454] Fix | Delete
<div class="diff">
[455] Fix | Delete
<# _.each( data.fields, function( field ) { #>
[456] Fix | Delete
<h3>{{ field.name }}</h3>
[457] Fix | Delete
{{{ field.diff }}}
[458] Fix | Delete
<# }); #>
[459] Fix | Delete
</div>
[460] Fix | Delete
</script>
[461] Fix | Delete
<?php
[462] Fix | Delete
}
[463] Fix | Delete
[464] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function