Make WordPress Core

Ticket #59229: 59229.patch

File 59229.patch, 2.0 KB (added by sajjad67, 21 months ago)

Fixed Few Coding Standards

  • wp-admin/edit-form-blocks.php

     
    320320        <div class="wrap hide-if-js block-editor-no-js">
    321321                <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
    322322                <?php
    323                 $message = sprintf(
    324                         /* translators: %s: A link to install the Classic Editor plugin. */
    325                         __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href="%s">Classic Editor plugin</a>.' ),
    326                         esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) )
    327                 );
     323                if ( file_exists( WP_PLUGIN_DIR . '/classic-editor/classic-editor.php' ) ) {
     324                        // If Classic Editor is already installed, provide a link to activate the plugin.
     325                        $plugin_activate_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=classic-editor/classic-editor.php', 'activate-plugin_classic-editor/classic-editor.php' );
    328326
     327                        $message = sprintf(
     328                                /* translators: %s: A link to activate the Classic Editor plugin. */
     329                                __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or <a href="%s">Activate Classic Editor</a> Plugin.' ),
     330                                esc_url( $plugin_activate_url )
     331                        );
     332                } else {
     333                        // If Classic Editor is not installed, provide a link to install it.
     334                        $plugin_install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-editor' ), 'install-plugin_classic-editor' );
     335                        $message = sprintf(
     336                                /* translators: %s: A link to install the Classic Editor plugin. */
     337                                __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or <a href="%s"> Install Classic Editor</a> Plugin.' ),
     338                                esc_url( $plugin_install_url )
     339                        );
     340                }
     341
    329342                /**
    330343                 * Filters the message displayed in the block editor interface when JavaScript is
    331344                 * not enabled in the browser.