[wp-trac] [WordPress Trac] #54233: Hardcoded wp-content instead of using WP_CONTENT_DIR

WordPress Trac noreply at wordpress.org
Fri Jun 17 10:45:59 UTC 2022

#54233: Hardcoded wp-content instead of using WP_CONTENT_DIR
 Reporter:  malthert      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:

Comment (by SergeyBiryukov):

 Replying to [comment:11 malthert]:
 > Basically I just need to remove the !defined check for WPINC and then
 this should be good to merge.

 I would say let's keep this ticket for `WP_CONTENT_DIR` only, that way it
 should be easier to review.

 > Replying to [comment:8 SergeyBiryukov]:
 > > The primary use of the `WP_CONTENT_DIR` and `WP_CONTENT_URL` constants
 is not to rename the folder, it's to support subdirectory installations
 with WordPress as an external.
 > Exactly, that's why `WP_CONTENT_DIR` needs to be checked if it already
 is defined. Since the method of not checking it may not work (e.g. if we
 have subdirectory/symlinked subdirectory, since `__DIR__` will not be the
 correct path)

 Looking at the PR, it seems that most of these instances should still work
 with symlinks, as long as the `wp-content` part of the path is not
 renamed. `__DIR__` is only used to define `ABSPATH`, and `WP_CONTENT_DIR`
 can then be used to replace `ABSPATH` with something else. So I'm a bit
 confused about the necessity of these changes, is it to also account for
 the `wp-content` part being renamed? I'm not really against that, just
 want to be clear about the use case.

Ticket URL: <https://core.trac.wordpress.org/ticket/54233#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list