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

WordPress Trac noreply at wordpress.org
Mon Oct 18 10:29:59 UTC 2021


#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:  trunk
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by malthert):

 >Upon a quick check I see that /wp-admin/load-styles.php also defines
 WP_CONTENT_DIR without checking if it's already defined. Maybe this is
 also a defect?

 Yes, this is a bug too. However, this is a major issue that would go
 beyond the scope of this ticket and should be handled on a separate
 ticket. (I can create and provide pull request)
 The simplest solution for this would be to actually completely remove the
 ABSPATH and WP_CONTENT_DIR here and require_once( wp-config.php ), so it's
 in line with WP standards (= user only needs to make changes in wp-
 config.php to set WP_CONTENT_DIR)

 >With wp-includes, I thought changing it wasn't supported, and it looks
 like none of the define statements for WPINC actually check that it isn't
 already defined, so the hard-coding of that one is maybe less of an issue.

 This will actually be my next ticket/pull request once this is merged (bc
 I don't want to waste time on rebasing). Since it only requires a few
 lines of code changed in a few files, I think we should give advanced
 users the possibility to define their own WPINC (e.g. via PHP
 auto_prepend_file)

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


More information about the wp-trac mailing list