Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#43781 new enhancement

adding apply_filters on $handle in localize

Reported by: duckdagobert's profile DuckDagobert Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.5
Component: Script Loader Keywords:
Focuses: Cc:

Description

in functions.wp-scripts.php we have:

return $wp_scripts->localize( $handle, $object_name, $l10n );

it would be nice to have an apply_filters on the $handle (with object_name as an argument optionally), since it would make overwriting it e.g. for a global concat minified file much easier & faster.
(bc now I have to get the scripts, then loop over it, localize the group,...) while I could do the whole thing with an apply_filters within 1 line.

Attachments (1)

43781.diff (600 bytes) - added by sebastien@… 6 years ago.

Download all attachments as: .zip

Change History (2)

@sebastien@…
6 years ago

#1 @sebastien@…
6 years ago

Hello @DuckDagobert ,

I'm quiet new in Core Contrib :-/
Hope my patch can help

Note: See TracTickets for help on using tickets.