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

Move setting of $original_upload_dir in S3_Uploads to the constructor #73

Open
fklein-lu opened this issue Nov 19, 2015 · 1 comment
Open

Comments

@fklein-lu
Copy link
Contributor

The S3_Uploads class contains a $original_upload_dir member variable. Its purpose is to store the array containing the data related to the original (i.e. on the local file system) upload directory.

This variable is set twice in the class, once in the filter_upload_dir() method (to the value passed by the filter), and once in get_original_upload_dir() (to the value returned by wp_upload_dir()).

This is ambiguous, I think we should set the value once in the constructor, to the value returned by wp_upload_dir(), and this before any filtering by the plugin could happen.

@joehoyle
Copy link
Member

wp_upload_dir is a slow function, so I'd rather not invoke it in the constructor, but yes there may be a better way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants