diff --git a/includes/media-kit/class-media-kit.php b/includes/media-kit/class-media-kit.php index bbe63ec5..b0730e9c 100644 --- a/includes/media-kit/class-media-kit.php +++ b/includes/media-kit/class-media-kit.php @@ -75,7 +75,7 @@ public static function activate() { * * @return int|false Post ID or false if the media kit page was not found. */ - private static function get_existing_page_id() { + public static function get_existing_page_id() { $args = [ 'post_type' => [ 'page' ], 'post_status' => [ 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private' ], @@ -93,6 +93,17 @@ private static function get_existing_page_id() { return $query->posts[0] ?? false; } + /** + * Get Media Kit page status. + */ + public static function get_page_status() { + $post_id = self::get_existing_page_id(); + if ( ! $post_id ) { + return 'non-existent'; + } + return get_post_status( $post_id ); + } + /** * A function to create a Publisher Media Kit page automatically. *