Opened 15 years ago
Closed 13 years ago
#14545 closed enhancement (worksforme)
move wp-settings from wp-config to wp-load
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.1 |
Component: | Inline Docs | Keywords: | has-patch |
Focuses: | Cc: |
Description
In 3.0 we added a number of constants which are manually added to wp-config.php. Some people are adding these to the bottom of the file after the stop editing & load of wp-settings.
This causes unpredictable behavior with some constants (ex. SUNRISE is defined in the admin area but sunrise.php isn't executed because SUNRISE was defined after loading wp-settings.
Attached is a patch that moves wp-settings.php to wp-load.php.
Attachments (3)
Change History (11)
#2
in reply to:
↑ 1
@
15 years ago
Replying to nacin:
Additionally, this is more of an education thing. The line says don't add anything past it. What else can we do?
Break a few sites that use hopelessly obsolete plugins? The suggested approach seems right in terms of backwards compat IMO. I'd suggest using a slightly better metric, like a function or class exists call. Something that we're sure won't get overridden by a plugin, or an API change, basically. But it's really nit picking.
#3
in reply to:
↑ 1
@
15 years ago
Replying to nacin:
This isn't backwards compatible...
It would work with any existing installs which load wp-settings in wp-config.
Replying to nacin:
More than a few plugins call wp-config.php directly, hence the additional conditional ABSPATH define.
Good point. It would break those plugins in new installs.
Replying to nacin:
What else can we do?
Yeah, I know. A bit of a rock and hard place. What about adding a last comment line instructing adding above the stop editing line?
#4
@
14 years ago
- Component changed from General to Inline Docs
- Keywords needs-patch 3.2-early added; has-patch removed
- Milestone changed from Awaiting Review to Future Release
What about adding a last comment line instructing adding above the stop editing line?
Sure.
#6
follow-up:
↓ 7
@
14 years ago
@jkudish - I would make the last line you added say "Do not add anything below this line."
Adding the extra comment at the bottom would address this one afaic.
Edited to add the word add above.
This isn't backwards compatible... More than a few plugins call wp-config.php directly, hence the additional conditional ABSPATH define. This used to be the proper way to deeply integrate, now you should use either wp-load or wp-blog-header depending on your objective, or in most cases admin-ajax or admin-post. wp-load was created specifically so wp-config can be moved up one directory, so WP can be used as an SVN external.
The only way to handle this is to deliberately define certain constants as false where defining the constant will not produce incompatibilities with plugins. For example, [14000].
Additionally, this is more of an education thing. The line says don't add anything past it. What else can we do?