• Resolved RS

    (@rsdotscot)


    Hi folks,

    Fantastic work with the plugin, I’ve been a fan for a long time πŸ™‚

    Up until now I’ve been loading the config file from within the themes I build, and that’s been great, but now I’m trying things out in moving much of my base functionality into an MU plugin. Now obviously MU plugins load before regular plugins, and so it seems putting the require_once inside a function that’s hooked to the init action (with the add_action being called within the MU plugin) means it’s trying to load the config file too early. Is there another hook and priority you would recommend in this scenario?

    Thanks in advance πŸ™‚

    Cheers,
    RS

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kev Provance

    (@kprovance)

    There is no official support for MU plugins. We messed with it seven years ago or so and couldn’t make it work. Today, there isn’t enough demand to justify the time. Sorry.

    Thread Starter RS

    (@rsdotscot)

    Hi Kev,

    It’s the strangest thing, from within the function that’s requiring the config file it recognises that RF is installed and active, but for whatever reason RF doesn’t do anything with the file. Bizarre.

    Cheers,
    RS

    Thread Starter RS

    (@rsdotscot)

    Hi Kev,

    Sorry to keep this going, but it probably makes sense to just call the function from the theme, but with that in mind, which hook should I use for that? I can define the function within my MU (as it’s really just my function library) then call it when the theme runs. Is there a hook you’d recommend?

    Cheers,
    RS

    Thread Starter RS

    (@rsdotscot)

    Hi Kev,

    Last one (I promise!), I was able to get it working, but without the use of a hook. I defined the function which requires the config file in my MU plugin and then just called it directly in the theme’s functions.php. It’s not absolutely ideal, but I’m happy to run with it for now πŸ™‚

    Cheers,
    RS

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Requiring config from within an MU plugin’ is closed to new replies.