WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 8 weeks ago

#46336 closed defect (bug) (fixed)

Support custom WP_PLUGIN_URL in load_script_textdomain()

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

Description

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 2 months ago.

Download all attachments as: .zip

Change History (3)

@ocean90
2 months ago

#1 @ocean90
2 months 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
8 weeks 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.

Note: See TracTickets for help on using tickets.