Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 364 characters in body
Source Link
jonnyK
  • 91
  • 2
  • 5

I currently have a global function in my functions.php file

ein_error_log($message)
{
      //push out $message to file... 
}

But I want to start using it in my MU-Plugin directory and it doesn't know it exists. So I assume it's because MU-Plugins folder is read before the theme folder in WordPress's hierarchy, which makes sense.

But if the hierarchy is the case, how do I distinguish which MU-Plugin runs first to make sure all other MU-Plugin files can run dependent on said file?

-- UPDATE--

I have my ein_error_log($message) method transferred into an mu-plugin file. I realized how silly it was to have mu-plugin files dependent on a method inside function.php file. But I still wanted the other mu-plugin files to also use this error logging method. This requires some mu-plugins to have a dependency. Its small, but important to me.

I currently have a global function in my functions.php file

ein_error_log($message)
{
      //push out $message to file... 
}

But I want to start using it in my MU-Plugin directory and it doesn't know it exists. So I assume it's because MU-Plugins folder is read before the theme folder in WordPress's hierarchy, which makes sense.

But if the hierarchy is the case, how do I distinguish which MU-Plugin runs first to make sure all other MU-Plugin files can run dependent on said file?

I currently have a global function in my functions.php file

ein_error_log($message)
{
      //push out $message to file... 
}

But I want to start using it in my MU-Plugin directory and it doesn't know it exists. So I assume it's because MU-Plugins folder is read before the theme folder in WordPress's hierarchy, which makes sense.

But if the hierarchy is the case, how do I distinguish which MU-Plugin runs first to make sure all other MU-Plugin files can run dependent on said file?

-- UPDATE--

I have my ein_error_log($message) method transferred into an mu-plugin file. I realized how silly it was to have mu-plugin files dependent on a method inside function.php file. But I still wanted the other mu-plugin files to also use this error logging method. This requires some mu-plugins to have a dependency. Its small, but important to me.

Source Link
jonnyK
  • 91
  • 2
  • 5

Where to put my global functions?

I currently have a global function in my functions.php file

ein_error_log($message)
{
      //push out $message to file... 
}

But I want to start using it in my MU-Plugin directory and it doesn't know it exists. So I assume it's because MU-Plugins folder is read before the theme folder in WordPress's hierarchy, which makes sense.

But if the hierarchy is the case, how do I distinguish which MU-Plugin runs first to make sure all other MU-Plugin files can run dependent on said file?