Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct usage of UPLOADS with tests #73

Merged
merged 5 commits into from
Feb 12, 2025

Conversation

kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Feb 12, 2025

In #70, I missed that WordPress automatically combines ABSPATH and UPLOADS when using wp_upload_dir, so the tests created worked, but when actually needing to use the custom dir, it didn't.

Added a test that checked for the existence of the folder (which should happen in Load:load()) which failed when it was created UPLOADS and passed when creating ABSPATH.UPLOADS.

@kraftbj
Copy link
Contributor Author

kraftbj commented Feb 12, 2025

Note: I'm working with this in Automattic/jetpack#41765 to make sure it is functional in real usage.

szepeviktor
szepeviktor previously approved these changes Feb 12, 2025
Copy link
Collaborator

@szepeviktor szepeviktor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using (global) constants feels like so PHP 4.

@kraftbj kraftbj merged commit 33e7d5a into trunk Feb 12, 2025
12 checks passed
@kraftbj kraftbj deleted the add/custom-wordbless-upload-dirs-2 branch February 12, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants