_wp_get_post_revision_version
Gets the post revision version.
Description
(int|false) _wp_get_post_revision_version( (WP_Post) $revision );
Returns (int|false)
Parameters (1)
- 0. $revision (WP_Post)
- The revision.
Usage
if ( !function_exists( '_wp_get_post_revision_version' ) ) { require_once ABSPATH . WPINC . '/revision.php'; } // The revision. $revision = null; // NOTICE! Understand what this does before running. $result = _wp_get_post_revision_version($revision);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/revision.php
- function _wp_get_post_revision_version( $revision ) {
- if ( is_object( $revision ) )
- $revision = get_object_vars( $revision );
- elseif ( !is_array( $revision ) )
- return false;
- if ( preg_match( '/^\d+-(?:autosave|revision)-v(\d+)$/', $revision['post_name'], $matches ) )
- return (int) $matches[1];
- return 0;
- }