WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#15121 closed defect (bug) (invalid)

TEMPLATEPATH does not work in mu-plugins folder

Reported by: volleyballmaniac Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Plugins Keywords: templatepath, plugin folder, mu plugins, plugin, plugins
Focuses: Cc:

Description

TEMPLATEPATH echoes null when used in a plugin (both plugins, and mu-plugins).

I'm not sure if this is by design, but it seems to be a shortcoming, as there comes a time when one needs to access something in the present Template folder.

Change History (1)

comment:1 nacin4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

We don't initialize the theme until well after plugins are loaded.

The solution is to wait to do whatever you are doing until a hook such as init. Ideally all plugin code should wait until then.

Note: See TracTickets for help on using tickets.