Making WordPress.org

Changeset 8130


Ignore:
Timestamp:
01/23/2019 09:21:33 PM (6 years ago)
Author:
coffee2code
Message:

Gutenberg: Add a noop get_current_screen() to prevent errors after update to Gutenberg v4.9.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/functions.php

    r8049 r8130  
    1212}
    1313
     14/**
     15 * Prevent errors resulting from change to Gutenberg plugin in 4.9 that adds call to
     16 * `get_current_screen()`.
     17 */
     18if ( ! function_exists( 'get_current_screen' ) && ! is_admin() && ! wp_doing_cron() ) {
     19    function get_current_screen() {
     20        return null;
     21    }
     22}
    1423
    1524add_action( 'template_redirect', function() {
Note: See TracChangeset for help on using the changeset viewer.