WordPress.org

Make WordPress Core

Ticket #45320: patch_4532.patch

File patch_4532.patch, 803 bytes (added by strategio, 21 months ago)

Patch to introduce the filter pre_load_script_textdomain

  • wp-includes/l10n.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    891891        $path   = untrailingslashit( $path );
    892892        $locale = is_admin() ? get_locale() : get_user_locale();
    893893
     894        $json_translations = apply_filters( 'pre_load_script_textdomain', false, $handle, $domain, $path, $locale );
     895
     896        if ( $json_translations ) {
     897                return $json_translations;
     898        }
     899
    894900        // If a path was given and the handle file exists simply return it.
    895901        $file_base       = $domain === 'default' ? $locale : $domain . '-' . $locale;
    896902        $handle_filename = $file_base . '-' . $handle . '.json';