WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 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:

Description

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 5 years ago.

Download all attachments as: .zip

Change History (3)

@sirzooro5 years ago

comment:1 @Denis-de-Bernardy5 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?

comment:2 @nacin5 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.