Make WordPress Core

Ticket #44680: 44680.diff

File 44680.diff, 934 bytes (added by pento, 6 years ago)
  • src/wp-admin/includes/dashboard.php

     
    2424
    2525        /* Register Widgets and Controls */
    2626
     27        // Try Gutenberg
     28
     29        // If Gutenberg isn't activated, only show the panel to users who can install and activate it.
     30        $plugins = get_plugins();
     31        if ( is_plugin_inactive( 'gutenberg/gutenberg.php' ) && ! current_user_can( 'install_plugins' ) ) {
     32                remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );
     33        }
     34        // If Gutenberg is activated, only show it to users who can use it.
     35        if ( is_plugin_active( 'gutenberg/gutenberg.php' ) && ! current_user_can( 'edit_posts' ) ) {
     36                remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );
     37        }
     38
    2739        $response = wp_check_browser_version();
    2840
    2941        if ( $response && $response['upgrade'] ) {