Open
Description
Reported by a user on the WordPress.org forum.
They are seeing the following fatal error occur on their site...
[31-Jan-2025 14:08:00 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/showmetechcom/public_html/wp-content/plugins/co-authors-plus/php/class-coauthors-plus.php:408
Stack trace:
#0 /home/showmetechcom/public_html/wp-content/plugins/co-authors-plus/php/class-coauthors-plus.php(974): CoAuthors_Plus->is_post_type_enabled(false)
#1 /home/showmetechcom/public_html/wp-includes/class-wp-hook.php(326): CoAuthors_Plus->coauthors_update_post(2859514, NULL)
#2 /home/showmetechcom/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 /home/showmetechcom/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /home/showmetechcom/public_html/wp-includes/post.php(5060): do_action('save_post', 2859514, NULL, false)
#5 /home/showmetechcom/public_html/wp-content/plugins/revisionary-pro/includes-pro/NotificationDefaults.php(282): wp_insert_post(Array)
#6 /home/showmetechcom/public_html/wp-content/plugins/revisionary-pro/includes-pro/NotificationDefaults.php(18): PublishPress\Revisions\NotificationDefaults->createDefaultWorkflowNotification('revision-schedu...')
#7 /home/showmetechcom/public_html/wp-content/plugins/revisionary-pro/includes-pro/pro-load.php(54): PublishPress\Revisions\NotificationDefaults->applyRevisionDefaults(true)
#8 /home/showmetechcom/public_html/wp-content/plugins/revisionary-pro/includes-pro/pro-load.php(11): RevisionaryPro->__construct()
#9 /home/showmetechcom/public_html/wp-content/plugins/revisionary-pro/revisionary-pro.php(140): RevisionaryPro::instance()
#10 /home/showmetechcom/public_html/wp-includes/class-wp-hook.php(324): {closure}('')
#11 /home/showmetechcom/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#12 /home/showmetechcom/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#13 /home/showmetechcom/public_html/wp-settings.php(559): do_action('plugins_loaded')
#14 /home/showmetechcom/public_html/wp-config.php(76): require_once('/home/showmetec...')
#15 /home/showmetechcom/public_html/wp-load.php(50): require_once('/home/showmetec...')
#16 /home/showmetechcom/public_html/wp-admin/admin-ajax.php(22): require_once('/home/showmetec...')
#17 {main}
thrown in /home/showmetechcom/public_html/wp-content/plugins/co-authors-plus/php/class-coauthors-plus.php on line 408
They're using PHP8.1.31 and WP 6.7.1.
Here's the code line in question - https://github.com/Automattic/Co-Authors-Plus/blob/develop/php/class-coauthors-plus.php#L408