diff --git a/config.php b/config.php index bcc5a97c2..7ee7d3d3e 100644 --- a/config.php +++ b/config.php @@ -4,7 +4,7 @@ # Define version constant if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) { - define( __NAMESPACE__ . '\VERSION', '3.1.16' ); + define( __NAMESPACE__ . '\VERSION', '3.1.17' ); } # Define root directory diff --git a/core/Container/Post_Meta_Container.php b/core/Container/Post_Meta_Container.php index ced307c2c..fe47c6dbd 100644 --- a/core/Container/Post_Meta_Container.php +++ b/core/Container/Post_Meta_Container.php @@ -175,11 +175,9 @@ protected function get_environment_for_object( $object_id ) { $post = get_post( intval( $object_id ) ); $post_type = $post->post_type; - if ( $post_type === 'revision' ) { - $parent = get_post( intval( $post->post_parent ) ); - if ( $parent ) { - $post_type = $parent->post_type; - } + if ( wp_is_post_revision( $post ) !== false ) { + $post = get_post( intval( $post->post_parent ) ); + $post_type = $post->post_type; } $environment = array( diff --git a/package.json b/package.json index 7f69b7f79..24c624749 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "carbon-fields", - "version": "3.1.16", + "version": "3.1.17", "description": "WordPress developer-friendly custom fields for post types, taxonomy terms, users, comments, widgets, options, navigation menus and more.", "directories": { "test": "tests"