WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3057 closed enhancement (wontfix)

No load wp-settings.php from wp-config.php

Reported by: forceagainstsomething Owned by:
Milestone: Priority: low
Severity: normal Version: 2.1
Component: Administration Keywords: settings, config has-patch
Focuses: Cc:

Description

Plugin developers may want to include the wp-config.php without loading wp-settings.php. Included is a patch to correct. Usage:

define('NOLOAD_WPSETTINGS', true);
include('wp-config.php');

Defining NOLOAD_WPSETTINGS tells WP to skip loading wp-settings.php.

Attachments (2)

noload.diff (352 bytes) - added by forceagainstsomething 9 years ago.
No load wp-settings patch
3057.diff (341 bytes) - added by Nazgul 9 years ago.

Download all attachments as: .zip

Change History (10)

@forceagainstsomething9 years ago

No load wp-settings patch

comment:1 @forceagainstsomething9 years ago

Just realized in the patch I put the code below the Turn register globals off comment. Suppose that should be above it.

@Nazgul9 years ago

comment:2 @Nazgul9 years ago

  • Keywords has-patch added
  • Milestone set to 2.1

Updated the attached patch according to forceagainstsomething's suggestions.

comment:3 @matt9 years ago

  • Milestone changed from 2.1 to 2.2

comment:4 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

comment:5 @markjaquith8 years ago

  • Milestone changed from 2.3 to 2.4 (next)
  • Priority changed from normal to low

Punting.

Can you provide an example of why a plugin author would want to do this?

comment:6 @intoxination8 years ago

I actually do the same basic thing on a couple of sites I manage. It's just to keep the database config information in one file and so other pages non WP dependent can access just the database connection information. It's a good idea, but I don't think it's a must, as the use will be very limited.

comment:7 @markjaquith8 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Limited use -- plus it would only work on new installs, since wp-config.php is never touched after install. So doesn't sound like a good candidate for core.

comment:8 @markjaquith8 years ago

  • Milestone 2.4 (next) deleted
Note: See TracTickets for help on using tickets.