Make WordPress Core


Ignore:
Timestamp:
07/31/2026 10:20:25 AM (11 days ago)
Author:
wildworks
Message:

Administration: Add no-JS fallbacks to route-based pages.

The Fonts and Connectors screens are rendered entirely by JavaScript, so they were completely empty when JavaScript is disabled. Both screens now render the page heading and an error notice, shown only when JavaScript is unavailable.

Props afercia, hbhalodia, wildworks.
Fixes #65690.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/font-library.php

    r61492 r62954  
    2929
    3030// Set the page title
    31 $title = _x( 'Fonts', 'Font Library admin page title' );
     31$title               = _x( 'Fonts', 'Font Library admin page title' );
     32$js_required_message = __( 'The Fonts screen requires JavaScript. Please enable JavaScript in your browser settings to install and manage fonts.' );
    3233
    3334require_once ABSPATH . 'wp-admin/admin-header.php';
     35
     36?>
     37<div class="wrap hide-if-js">
     38        <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
     39        <?php
     40                wp_admin_notice(
     41                        $js_required_message,
     42                        array(
     43                                'type'               => 'error',
     44                                'additional_classes' => array( 'hide-if-js' ),
     45                        )
     46                );
     47                ?>
     48</div>
     49<?php
    3450
    3551// Render the Font Library page
Note: See TracChangeset for help on using the changeset viewer.