wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_post_revisions_url › WordPress Function
Seit5.9.0
Veraltetn/v
› wp_get_post_revisions_url ( $post = 0 )
| Parameter: |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
Returns the url for viewing and potentially restoring revisions of a given post.
Ähnliche Funktionen: wp_get_post_revisions, wp_get_post_revision, wp_list_post_revisions, _wp_get_post_revision_version, wp_delete_post_revision
Quellcode
function wp_get_post_revisions_url( $post = 0 ) {
$post = get_post( $post );
if ( ! $post instanceof WP_Post ) {
return null;
}
// If the post is a revision, return early.
if ( 'revision' === $post->post_type ) {
return get_edit_post_link( $post );
}
if ( ! wp_revisions_enabled( $post ) ) {
return null;
}
$revisions = wp_get_latest_revision_id_and_total_count( $post->ID );
if ( is_wp_error( $revisions ) || 0 === $revisions['count'] ) {
return null;
}
return get_edit_post_link( $revisions['latest_id'] );
}