cbsk10
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple Custom CSS and JS] humanmade/S3-Uploads compatibilityHi @diana_burduja, thanks for the reply.
I’m working with a multisite WordPress installation, but I cannot move the plugins to
mu-pluginsdue some restrictions that I have on hosting siteAnd hardcoding variables is not a feasible solution because the path has to be dynamic like
S3_UPLOADS_BUCKET/uploads/sites/BLOG_ID/custom-css-js'so I don’t think it fits with my needs.
Maybe
plugins_loadedhook is better then the init? 🙂Because the S3 plugins starts with this hook. https://github.com/humanmade/S3-Uploads/blob/master/s3-uploads.php
What do you think?
Forum: Plugins
In reply to: [Simple Custom CSS and JS] humanmade/S3-Uploads compatibilityHi @diana_burduja, I found the issue!
Inside the
custom-css-js.phpfile, into the__constructfunction, the function$this->set_constants();is not called inside the WordPress lifecycle and this is why is not working with other plugins (in this case the S3 upload).The function
wp_upload_dircalled inside theset_constantsfunction has inside some WordPress hooks that are not available for other plugins because these plugins are loaded after this initialisation.I tried to wrap most of the
__constructcost inside theinithook and everything seems working well.Image attached of the small refactoring.

Waiting for your feedback.
Thanks!