Make WordPress Core

Ticket #55023: 55023.wip.diff

File 55023.wip.diff, 3.9 KB (added by sabernhardt, 2 years ago)

an attempt at updating the theme-compat files, also replacing the special title function

  • src/wp-includes/block-template.php

     
    109109        // Add viewport meta tag.
    110110        add_action( 'wp_head', '_block_template_viewport_meta_tag', 0 );
    111111
    112         // Render title tag with content, regardless of whether theme has title-tag support.
    113         remove_action( 'wp_head', '_wp_render_title_tag', 1 );    // Remove conditional title tag rendering...
    114         add_action( 'wp_head', '_block_template_render_title_tag', 1 ); // ...and make it unconditional.
    115 
    116112        // This file will be included instead of the theme's template file.
    117113        return ABSPATH . WPINC . '/template-canvas.php';
    118114}
  • src/wp-includes/general-template.php

     
    12821282 * @ignore
    12831283 * @since 4.1.0
    12841284 * @since 4.4.0 Improved title output replaced `wp_title()`.
     1285 * @since 6.1.0 Made all block themes support title tag without needing to declare it.
    12851286 * @access private
    12861287 */
    12871288function _wp_render_title_tag() {
    1288         if ( ! current_theme_supports( 'title-tag' ) ) {
     1289        if ( ! current_theme_supports( 'title-tag' ) && ! wp_is_block_theme() ) {
    12891290                return;
    12901291        }
    12911292
  • src/wp-includes/script-loader.php

     
    24632463 * @return bool Whether separate assets will be loaded.
    24642464 */
    24652465function wp_should_load_separate_core_block_assets() {
    2466         if ( is_admin() || is_feed() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
     2466        if ( is_admin() || is_feed() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || ( is_multisite() && ( strpos( $_SERVER['PHP_SELF'], 'wp-signup.php' ) || strpos( $_SERVER['PHP_SELF'], 'wp-activate.php' ) ) ) ) {
    24672467                return false;
    24682468        }
    24692469
  • src/wp-includes/theme-compat/footer.php

     
    66 *
    77 * This file is here for backward compatibility with old themes and will be removed in a future version
    88 */
     9if ( wp_is_block_theme() ) :
     10        ?>
     11        <footer class="wp-block-template-part">
     12                <?php block_footer_area(); ?>
     13        </footer>
     14</div>
     15        <?php
     16else:
     17
    918_deprecated_file(
    1019        /* translators: %s: Template name. */
    1120        sprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),
     
    3544<!-- Gorgeous design by Michael Heilemann - http://binarybonsai.com/ -->
    3645<?php /* "Just what do you think you're doing Dave?" */ ?>
    3746
    38                 <?php wp_footer(); ?>
     47
     48<?php endif; // wp_is_block_theme() ?>
     49<?php wp_footer(); ?>
    3950</body>
    4051</html>
  • src/wp-includes/theme-compat/header.php

     
    66 *
    77 * This file is here for backward compatibility with old themes and will be removed in a future version.
    88 */
     9if ( wp_is_block_theme() ) :
     10        ?>
     11<!DOCTYPE html>
     12<html <?php language_attributes(); ?>>
     13<head>
     14        <meta charset="<?php bloginfo( 'charset' ); ?>" />
     15        <meta name="viewport" content="width=device-width, initial-scale=1" />
     16        <?php wp_head(); ?>
     17</head>
     18
     19<body <?php body_class(); ?>>
     20<?php wp_body_open(); ?>
     21
     22<div class="wp-site-blocks">
     23
     24        <header class="wp-block-template-part">
     25                <?php block_header_area(); ?>
     26        </header>
     27
     28        <?php
     29
     30else:
     31
    932_deprecated_file(
    1033        /* translators: %s: Template name. */
    1134        sprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),
     
    5881        </div>
    5982</div>
    6083<hr />
     84
     85        <?php
     86endif;