Make WordPress Core


Ignore:
Timestamp:
10/21/2024 02:11:56 PM (19 months ago)
Author:
swissspidy
Message:

I18N: Fix script languages path on Multisite.

This is a follow-up to [59126] (itself a follow-up to [57922]), which caused a regression when determining the right path when loading script translations.

Props swissspidy, themes-1, staurand.
Fixes #62016.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php

    r59126 r59264  
    2929    }
    3030
    31     public function data_resolve_relative_path() {
     31    public static function data_resolve_relative_path() {
    3232        return array(
    3333            // @ticket 45528
     
    4444                'https://my-cdn.com/wordpress/wp-includes/js/script.js',
    4545                'default',
    46                 array( 'load_script_textdomain_relative_path', array( $this, 'relative_path_from_cdn' ), 2 ),
     46                array( 'load_script_textdomain_relative_path', array( __CLASS__, 'relative_path_from_cdn' ), 2 ),
    4747            ),
    4848            // Test for WordPress installs in a subdirectory.
     
    147147    }
    148148
    149     public function relative_path_from_cdn( $relative, $src ) {
     149    public static function relative_path_from_cdn( $relative, $src ) {
    150150        if ( 0 === strpos( $src, 'https://my-cdn.com/wordpress/' ) ) {
    151151            return substr( $src, strlen( 'https://my-cdn.com/wordpress/' ) );
Note: See TracChangeset for help on using the changeset viewer.