Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#46336 closed defect (bug) (fixed)

Support custom WP_PLUGIN_URL in load_script_textdomain()

Reported by: ocean90's profile ocean90 Owned by: ocean90's profile ocean90
Milestone: 5.3 Priority: normal
Severity: normal Version: 5.0
Component: I18N Keywords: has-patch has-unit-tests has-dev-note
Focuses: Cc:


load_script_textdomain() is currently unable to find the JSON file in WP_LANG_DIR when a custom WP_PLUGIN_URL is defined. By default its defined with WP_CONTENT_URL . '/plugins' so it's covered by the content_url() check.
To make it work with a non-default URLs we should add an additional check for plugins_url().

Attachments (1)

46336.patch (4.2 KB) - added by ocean90 5 years ago.

Download all attachments as: .zip

Change History (4)

5 years ago

#1 @ocean90
5 years ago

  • Keywords has-patch has-unit-tests added; needs-patch removed
  • Milestone changed from Future Release to 5.3
  • Owner set to ocean90
  • Status changed from new to accepted

46336.patch also includes a fix for #46387.

#2 @ocean90
5 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 45685:

I18N: Add support for custom WP_PLUGIN_URL in load_script_textdomain().

Plugins may not be on the same host/path as the rest of the content. To support loading translations for this setup check if the script source matches plugins_url().
Also fixes an undefined index notice when a custom content URL has no path.

Props odminstudios, ocean90.
Fixes #46336, #46387.

#3 @desrosj
5 years ago

  • Keywords has-dev-note added

Mentioned in the Miscellaneous Developer Focused Changes dev note for 5.3:

Note: See TracTickets for help on using tickets.