Make WordPress Core

Changeset 61925


Ignore:
Timestamp:
03/11/2026 01:20:35 AM (2 weeks ago)
Author:
peterwilsoncc
Message:

Grouped backports for the 6.5 branch.

  • Customize: Introduce a fix for themes that pass a stringable object through the template_include filter despite it being documented as only accepting a string.
  • Update version string following r61904.

Props dmsnell, desrosj, westonruter.

Location:
branches/6.5
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/6.5

  • branches/6.5/src/wp-includes/class-wp-block-patterns-registry.php

    r61921 r61925  
    200200        }
    201201
    202         $pattern_path = realpath( $patterns[ $pattern_name ]['filePath'] ?? '' );
     202        $file_path    = $patterns[ $pattern_name ]['filePath'] ?? '';
     203        $is_stringy   = is_string( $file_path ) || ( is_object( $file_path ) && method_exists( $file_path, '__toString' ) );
     204        $pattern_path = $is_stringy ? realpath( (string) $file_path ) : null;
    203205        if (
    204206            ! isset( $patterns[ $pattern_name ]['content'] ) &&
  • branches/6.5/src/wp-includes/interactivity-api/class-wp-interactivity-api.php

    r61921 r61925  
    614614                            esc_attr( 'data-wp-on--' . substr( $bound_attribute, 2 ) )
    615615                        ),
    616                         'x.y.z'
     616                        '6.9.2'
    617617                    );
    618618                    continue;
  • branches/6.5/src/wp-includes/template-loader.php

    r61921 r61925  
    102102     * @param string $template The path of the template to include.
    103103     */
    104     $template = apply_filters( 'template_include', $template );
    105     $template = is_string( $template ) ? realpath( $template ) : null;
     104    $template   = apply_filters( 'template_include', $template );
     105    $is_stringy = is_string( $template ) || ( is_object( $template ) && method_exists( $template, '__toString' ) );
     106    $template   = $is_stringy ? realpath( (string) $template ) : null;
    106107    if (
    107108        is_string( $template ) &&
Note: See TracChangeset for help on using the changeset viewer.