From 1113d77e60a776b63af08b85befbe55e8c4ec6aa Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Tue, 2 Mar 2021 11:53:55 -0800 Subject: [PATCH] Add rest field based on support for revisions, rather than whether UI is shown I suspect this would target the right post types more accurately, since some may register with `show_ui` but without support for revisions. --- revision-notes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/revision-notes.php b/revision-notes.php index a25fe48..5f811fb 100644 --- a/revision-notes.php +++ b/revision-notes.php @@ -37,8 +37,8 @@ public function init() { add_filter( 'wp_post_revision_title_expanded', array( $this, 'wp_post_revision_title_expanded' ), 10, 2 ); // Use post_type_supports() to make showing/hiding of the field easy for devs. - // By default we'll show it for any post type that has an edit UI. - $post_types = get_post_types( array( 'show_ui' => true ) ); + // By default we'll show it for any post type that supports revisions. + $post_types = get_post_types_by_support( 'revisions' ); if ( ! empty( $post_types ) ) { foreach ( $post_types as $post_type ) {