Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cbsk10

    (@cbsk10)

    Hi @diana_burduja, thanks for the reply.

    I’m working with a multisite WordPress installation, but I cannot move the plugins to mu-plugins due some restrictions that I have on hosting site

    And 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_loaded hook 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?

    Thread Starter cbsk10

    (@cbsk10)

    Hi @diana_burduja, I found the issue!

    Inside the custom-css-js.php file, into the __construct function, 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_dir called inside the set_constants function 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 __construct cost inside the init hook and everything seems working well.

    Image attached of the small refactoring.

    Waiting for your feedback.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)