Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#11840 closed enhancement (wontfix)

Define WP_PLUGIN_DIR before loading db.php

Reported by: sirzooro Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9.1
Component: General Keywords: has-patch 2nd-opinion
Focuses: Cc:


In my plugin (DB Cache Reloaded) I provide custom db.php file, and in in I need to know the plugin directory. Unfortunately WP_PLUGIN_DIR is defined after this file is loaded, so now I have to define it in my plugin.

Attached patch moves this define before db.php is loaded.

Attachments (1)

wp-settings.php.diff (920 bytes) - added by sirzooro 11 years ago.

Download all attachments as: .zip

Change History (3)

#1 @Denis-de-Bernardy
11 years ago

  • Keywords 2nd-opinion added; tested removed

Is this not to allow plugins to override it or something? If not, would it make sense to move a couple more defines?

#2 @nacin
11 years ago

  • Milestone 3.0 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Many default constants are defined at specific places so they can be overridden (like here). The plugin directory constants for example may be defined in sunrise.php. You can wait until after WP_PLUGIN_DIR is defined to do what you need, or simply define it.

Note: See TracTickets for help on using tickets.