wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
_wp_post_revision_data is private and should not be used in themes or plugins directly.
_wp_post_revision_data › WordPress Function
Seit4.5.0
Veraltetn/v
› _wp_post_revision_data ( $post = array(), $autosave = false )
Zugriff: |
|
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Returns a post array ready to be inserted into the posts table as a post revision.
Ähnliche Funktionen: _wp_post_revision_fields, wp_post_revision_title, wp_post_revision_meta_keys, _wp_put_post_revision, wp_is_post_revision
Quellcode
function _wp_post_revision_data( $post = array(), $autosave = false ) { if ( ! is_array( $post ) ) { $post = get_post( $post, ARRAY_A ); } $fields = _wp_post_revision_fields( $post ); $revision_data = array(); foreach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field ) { $revision_data[ $field ] = $post[ $field ]; } $revision_data['post_parent'] = $post['ID']; $revision_data['post_status'] = 'inherit'; $revision_data['post_type'] = 'revision'; $revision_data['post_name'] = $autosave ? "$post[ID]-autosave-v1" : "$post[ID]-revision-v1"; // "1" is the revisioning system version. $revision_data['post_date'] = isset( $post['post_modified'] ) ? $post['post_modified'] : ''; $revision_data['post_date_gmt'] = isset( $post['post_modified_gmt'] ) ? $post['post_modified_gmt'] : ''; return $revision_data; }