Make WordPress Core

Ticket #41316: 41316.19.diff

File 41316.19.diff, 4.1 KB (added by pento, 5 years ago)
  • src/wp-admin/css/dashboard.css

     
    127127.try-gutenberg-panel h3 {
    128128        margin: 17px 0 0;
    129129        font-size: 16px;
     130        line-height: 1.4em;
    130131}
    131132
    132133.welcome-panel li,
  • src/wp-admin/includes/dashboard.php

     
    16321632
    16331633        if ( current_user_can( 'install_plugins' ) ) {
    16341634                if ( empty( $plugins['gutenberg/gutenberg.php'] ) ) {
    1635                         $action = __( 'Install Gutenberg' );
    1636                         $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=gutenberg' ), 'install-plugin_gutenberg' );
    1637                         $classes = ' install-now';
     1635                        if ( get_filesystem_method( array(), WP_PLUGIN_DIR ) === 'direct' ) {
     1636                                $action = __( 'Install Gutenberg' );
     1637                                $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=gutenberg' ), 'install-plugin_gutenberg' );
     1638                                $classes = ' install-now';
     1639                        }
    16381640                } else if ( is_plugin_inactive( 'gutenberg/gutenberg.php' ) ) {
    16391641                        $action = __( 'Activate Gutenberg' );
    16401642                        $url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=gutenberg/gutenberg.php&from=try-gutenberg' ), 'activate-plugin_gutenberg/gutenberg.php' );
     
    16421644                }
    16431645
    16441646                if ( empty( $plugins['classic-editor/classic-editor.php'] ) ) {
    1645                         $classic_action = __( 'Install the Classic Editor' );
    1646                         $classic_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-editor' ), 'install-plugin_classic-editor' );
    1647                         $classic_classes = ' install-now';
     1647                        if ( get_filesystem_method( array(), WP_PLUGIN_DIR ) === 'direct' ) {
     1648                                $classic_action = __( 'Install the Classic Editor' );
     1649                                $classic_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-editor' ), 'install-plugin_classic-editor' );
     1650                                $classic_classes = ' install-now';
     1651                        }
    16481652                } else if ( is_plugin_inactive( 'classic-editor/classic-editor.php' ) ) {
    16491653                        $classic_action = __( 'Activate the Classic Editor' );
    16501654                        $classic_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php&from=try-gutenberg' ), 'activate-plugin_classic-editor/classic-editor.php' );
     
    16951699                                        </p>
    16961700                                </div>
    16971701
     1702                                <div class="try-gutenberg-action">
    16981703                                        <?php if ( $action ) { ?>
    1699                                                 <div class="try-gutenberg-action">
    1700                                                         <p><a class="button button-primary button-hero<?php echo $classes; ?>" href="<?php echo esc_url( $url ); ?>" data-name="<?php esc_attr_e( 'Gutenberg' ); ?>" data-slug="gutenberg"><?php echo $action; ?></a></p>
    1701                                                         <p>
    1702                                                                 <?php
    1703                                                                         printf(
    1704                                                                                 /* translators: Link to https://wordpress.org/gutenberg/ */
    1705                                                                                 __( '<a href="%s">Learn more about Gutenberg</a>' ),
    1706                                                                                 __( 'https://wordpress.org/gutenberg/' )
    1707                                                                         );
    1708                                                                 ?>
    1709                                                         </p>
    1710                                                 </div>
     1704                                                <p><a class="button button-primary button-hero<?php echo $classes; ?>" href="<?php echo esc_url( $url ); ?>" data-name="<?php esc_attr_e( 'Gutenberg' ); ?>" data-slug="gutenberg"><?php echo $action; ?></a></p>
    17111705                                        <?php } ?>
     1706
     1707                                        <p>
     1708                                                <?php
     1709                                                        printf(
     1710                                                                /* translators: Link to https://wordpress.org/gutenberg/ */
     1711                                                                __( '<a href="%s">Learn more about Gutenberg</a>' ),
     1712                                                                __( 'https://wordpress.org/gutenberg/' )
     1713                                                        );
     1714                                                ?>
     1715                                        </p>
     1716
     1717                                        <?php
     1718                                                /**
     1719                                                 * This action fires after the "Install Gutenberg" button is displayed.
     1720                                                 *
     1721                                                 * It allows hosts or site owners to add links to extra information about
     1722                                                 * Gutenberg, specific to their service.
     1723                                                 *
     1724                                                 * WARNING: This action will only exist in the 4.9.x series, it will not be
     1725                                                 * added to WordPress 5.0 and later.
     1726                                                 *
     1727                                                 * @since 4.9.8
     1728                                                 */
     1729                                                do_action( 'try_gutenberg_after_install_button' );
     1730                                        ?>
     1731                                </div>
    17121732                        </div>
    17131733
    17141734                        <div class="try-gutenberg-panel-column plugin-card-classic-editor">