wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_post_revisions › WordPress Function
Seit2.6.0
Veraltetn/v
› wp_get_post_revisions ( $post = 0, $args = null )
| Parameter: (2) |
|
| Siehe: | |
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
Returns all revisions of specified post.
Ähnliche Funktionen: wp_get_post_revision, wp_get_post_revisions_url, wp_list_post_revisions, _wp_put_post_revision, wp_delete_post_revision
Quellcode
function wp_get_post_revisions( $post = 0, $args = null ) {
$post = get_post( $post );
if ( ! $post || empty( $post->ID ) ) {
return array();
}
$defaults = array(
'order' => 'DESC',
'orderby' => 'date ID',
'check_enabled' => true,
);
$args = wp_parse_args( $args, $defaults );
if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) ) {
return array();
}
$args = array_merge(
$args,
array(
'post_parent' => $post->ID,
'post_type' => 'revision',
'post_status' => 'inherit',
)
);
$revisions = get_children( $args );
if ( ! $revisions ) {
return array();
}
return $revisions;
}