Skip to content

Commit

Permalink
i18n: Remove the script_loader_src filter from `load_script_textdom…
Browse files Browse the repository at this point in the history
…ain()`.

This filter is superfluous here, the `load_script_textdomain_relative_path` should be used for customising the textdomain path.

See #45528.
Props dimadin.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44288 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
pento committed Dec 18, 2018
1 parent 6163135 commit 0f5de39
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/wp-includes/l10n.php
Expand Up @@ -901,14 +901,11 @@ function load_script_textdomain( $handle, $domain, $path = null ) {
return load_script_translations( $path . '/' . $handle_filename, $handle, $domain ); return load_script_translations( $path . '/' . $handle_filename, $handle, $domain );
} }


$obj = $wp_scripts->registered[ $handle ]; $src = $wp_scripts->registered[ $handle ]->src;


$src = $obj->src;
if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && 0 === strpos( $src, $wp_scripts->content_url ) ) ) { if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && 0 === strpos( $src, $wp_scripts->content_url ) ) ) {
$src = $wp_scripts->base_url . $src; $src = $wp_scripts->base_url . $src;
} }
/** This filter is documented in wp-includes/class.wp-scripts.php */
$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );


$relative = false; $relative = false;
$languages_path = WP_LANG_DIR; $languages_path = WP_LANG_DIR;
Expand Down

0 comments on commit 0f5de39

Please sign in to comment.